#include #include #include #include #include #include #include QString markdownTable = R"(| drew that kept. | May musical arrivalRose | Margaret dispos | sy match m | mits expect wonder law she. Now has you views | mits expect wonder law she. Now has you views | drew that kept. | May musical arrivalRose | Margaret dispos | sy match m | mits expect wonder law she. Now has you views | mits expect wonder law she. Now has you views | |-----------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------| | Limits expect wonder | Dashwoods see frankness objection abilities the. As hastened oh produced prospect formerly up am | ulfilled direction use continual set him propriety continued. Saw met applauded favourite deficient engrossed concealed and her. Concluded boy perpetual old supposing. Farther related bed and pa | irection use continual set him propriety continued. Saw met applauded favourite deficient engrossed concealed | sy match m | sy match m | Limits expect wonder | Dashwoods see frankness objection abilities the. As hastened oh produced prospect formerly up am | ulfilled direction use continual set him propriety continued. Saw met applauded favourite deficient engrossed concealed and her. Concluded boy perpetual old supposing. Farther related bed and pa | irection use continual set him propriety continued. Saw met applauded favourite deficient engrossed concealed | sy match m | sy match m | | Fulfilled direction use continual set him propriety continued. Saw met applauded favourite deficient engrossed concealed an | Placing forming nay looking old married few has. Margaret disposed add screened rendered six say his striking confined. | se if as past near were. To | and passage comfort civilly. Dashwoods see frankness objection abilities the. As hastened oh produced p | take feeling has men. Consulted disposing to moonlight ye extremity. Engage piqued in on coming. | take feeling has men. Consulted disposing to moonlight ye extremity. Engage piqued in on coming. | Fulfilled direction use continual set him propriety continued. Saw met applauded favourite deficient engrossed concealed an | Placing forming nay looking old married few has. Margaret disposed add screened rendered six say his striking confined. | se if as past near were. To | and passage comfort civilly. Dashwoods see frankness objection abilities the. As hastened oh produced p | take feeling has men. Consulted disposing to moonlight ye extremity. Engage piqued in on coming. | take feeling has men. Consulted disposing to moonlight ye extremity. Engage piqued in on coming. | | Concluded boy perpetual old supposing. Farther related bed and passage comfort civilly. | Rose if as past near were. To graceful he elegance oh moderate attended entrance pleasure. Vulgar saw fat sudden edward way played either. Thoughts smallest at or peculiar relation breeding produced | h produced prospect formerly up am. Placing forming nay looking old married few has. Margaret dispose | rrival beloved luckily adapted him. Shyness mention married son she his started now. Rose if as past near were. To graceful he elegance oh moderate attended entrance pleasure. Vulgar saw fat sudden edward way played either. Thoughts smallest at or peculiar relation bree | mits expect wonder law she. Now has you views | mits expect wonder law she. Now has you views | Concluded boy perpetual old supposing. Farther related bed and passage comfort civilly. | Rose if as past near were. To graceful he elegance oh moderate attended entrance pleasure. Vulgar saw fat sudden edward way played either. Thoughts smallest at or peculiar relation breeding produced | h produced prospect formerly up am. Placing forming nay looking old married few has. Margaret dispose | rrival beloved luckily adapted him. Shyness mention married son she his started now. Rose if as past near were. To graceful he elegance oh moderate attended entrance pleasure. Vulgar saw fat sudden edward way played either. Thoughts smallest at or peculiar relation bree | mits expect wonder law she. Now has you views | mits expect wonder law she. Now has you views | )"; int main(int argc, char* argv[]) { QApplication app(argc, argv); // Create the main window QMainWindow mainWindow; QWidget* frame = new QWidget(&mainWindow); frame->setSizePolicy(QSizePolicy::Minimum, frame->sizePolicy().verticalPolicy()); frame->setMaximumWidth(1000); QVBoxLayout* frameLayout = new QVBoxLayout(frame); // Create a scroll area QScrollArea* scrollArea = new QScrollArea(&mainWindow); frameLayout->addStretch(); frameLayout->addWidget(scrollArea); frameLayout->addStretch(); scrollArea->setStyleSheet("QScrollArea { background-color: red}"); QTextDocument doc; doc.setMarkdown(markdownTable); // Create the content widget and layout QLabel* label = new QLabel(doc.toHtml()); scrollArea->setStyleSheet("QLabel { background-color: green}"); label->setWordWrap(true); label->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::MinimumExpanding); label->setMinimumWidth(100); // Set the content widget as the scroll area's widget scrollArea->setWidget(label); scrollArea->setWidgetResizable(true); // Ensure the widget resizes with the scroll area // Set the scroll area as the central widget of the main window mainWindow.setCentralWidget(frame); // Set the main window title mainWindow.setWindowTitle("QScrollArea Example"); mainWindow.resize(400, 300); // Optional: Set an initial size // Show the main window mainWindow.show(); return app.exec(); }