summaryrefslogtreecommitdiffstats
path: root/examples/tutorials/widgets/nestedlayouts/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/tutorials/widgets/nestedlayouts/main.cpp')
-rw-r--r--examples/tutorials/widgets/nestedlayouts/main.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/tutorials/widgets/nestedlayouts/main.cpp b/examples/tutorials/widgets/nestedlayouts/main.cpp
index 29996c6..33f9ad2 100644
--- a/examples/tutorials/widgets/nestedlayouts/main.cpp
+++ b/examples/tutorials/widgets/nestedlayouts/main.cpp
@@ -46,9 +46,9 @@
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
- QWidget *window = new QWidget();
+ QWidget window;
- QLabel *queryLabel = new QLabel(tr("Query:"));
+ QLabel *queryLabel = new QLabel(QObject::tr("Query:"));
QLineEdit *queryEdit = new QLineEdit();
QTableView *resultView = new QTableView();
@@ -59,14 +59,15 @@ int main(int argc, char *argv[])
QVBoxLayout *mainLayout = new QVBoxLayout();
mainLayout->addLayout(queryLayout);
mainLayout->addWidget(resultView);
- window->setLayout(mainLayout);
+ window.setLayout(mainLayout);
// Set up the model and configure the view...
//! [first part]
//! [set up the model]
QStandardItemModel model;
- model.setHorizontalHeaderLabels(QStringList() << tr("Name") << tr("Office"));
+ model.setHorizontalHeaderLabels(
+ QStringList() << QObject::tr("Name") << QObject::tr("Office"));
QList<QStringList> rows = QList<QStringList>()
<< (QStringList() << "Verne Nilsen" << "123")
@@ -92,8 +93,8 @@ int main(int argc, char *argv[])
resultView->horizontalHeader()->setStretchLastSection(true);
//! [set up the model]
//! [last part]
- window->setWindowTitle(tr("Nested layouts"));
- window->show();
+ window.setWindowTitle(QObject::tr("Nested layouts"));
+ window.show();
return app.exec();
}
//! [last part]