#include int main(int argc, char **argv) { QApplication app(argc, argv); QWidget mainWindow; QDialog *dialog = new QDialog(&mainWindow); QBoxLayout *layout = new QBoxLayout(QBoxLayout::LeftToRight, dialog); QLabel *label = new QLabel("Test test test test test testtesttest testest test", dialog); label->setWordWrap(true); layout->addWidget(label); mainWindow.show(); dialog->show(); return app.exec(); }