summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/tutorials/widgets/childwidget/main.cpp5
-rw-r--r--examples/tutorials/widgets/nestedlayouts/main.cpp9
-rw-r--r--examples/tutorials/widgets/toplevel/main.cpp3
-rw-r--r--examples/tutorials/widgets/windowlayout/main.cpp5
4 files changed, 14 insertions, 8 deletions
diff --git a/examples/tutorials/widgets/childwidget/main.cpp b/examples/tutorials/widgets/childwidget/main.cpp
index 8674b6e..fd50b1d 100644
--- a/examples/tutorials/widgets/childwidget/main.cpp
+++ b/examples/tutorials/widgets/childwidget/main.cpp
@@ -47,11 +47,12 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
QWidget window;
window.resize(320, 240);
- window.setWindowTitle(QObject::tr("Child widget"));
+ window.setWindowTitle(QApplication::translate("childwidget", "Child widget"));
window.show();
//! [create, position and show]
- QPushButton *button = new QPushButton(QObject::tr("Press me"), &window);
+ QPushButton *button = new QPushButton(
+ QApplication::translate("childwidget", "Press me"), &window);
button->move(100, 100);
button->show();
//! [create, position and show]
diff --git a/examples/tutorials/widgets/nestedlayouts/main.cpp b/examples/tutorials/widgets/nestedlayouts/main.cpp
index 33f9ad2..226d0f9 100644
--- a/examples/tutorials/widgets/nestedlayouts/main.cpp
+++ b/examples/tutorials/widgets/nestedlayouts/main.cpp
@@ -48,7 +48,8 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
QWidget window;
- QLabel *queryLabel = new QLabel(QObject::tr("Query:"));
+ QLabel *queryLabel = new QLabel(
+ QApplication::translate("nestedlayouts", "Query:"));
QLineEdit *queryEdit = new QLineEdit();
QTableView *resultView = new QTableView();
@@ -67,7 +68,8 @@ int main(int argc, char *argv[])
//! [set up the model]
QStandardItemModel model;
model.setHorizontalHeaderLabels(
- QStringList() << QObject::tr("Name") << QObject::tr("Office"));
+ QStringList() << QApplication::translate("nestedlayouts", "Name")
+ << QApplication::translate("nestedlayouts", "Office"));
QList<QStringList> rows = QList<QStringList>()
<< (QStringList() << "Verne Nilsen" << "123")
@@ -93,7 +95,8 @@ int main(int argc, char *argv[])
resultView->horizontalHeader()->setStretchLastSection(true);
//! [set up the model]
//! [last part]
- window.setWindowTitle(QObject::tr("Nested layouts"));
+ window.setWindowTitle(
+ QApplication::translate("nestedlayouts", "Nested layouts"));
window.show();
return app.exec();
}
diff --git a/examples/tutorials/widgets/toplevel/main.cpp b/examples/tutorials/widgets/toplevel/main.cpp
index 25ebd3f..f18fa6b 100644
--- a/examples/tutorials/widgets/toplevel/main.cpp
+++ b/examples/tutorials/widgets/toplevel/main.cpp
@@ -50,7 +50,8 @@ int main(int argc, char *argv[])
window.resize(320, 240);
window.show();
//! [create, resize and show]
- window.setWindowTitle(QObject::tr("Top-level widget"));
+ window.setWindowTitle(
+ QApplication::translate("toplevel", "Top-level widget"));
return app.exec();
}
//! [main program]
diff --git a/examples/tutorials/widgets/windowlayout/main.cpp b/examples/tutorials/widgets/windowlayout/main.cpp
index 15a11e1..c30d669 100644
--- a/examples/tutorials/widgets/windowlayout/main.cpp
+++ b/examples/tutorials/widgets/windowlayout/main.cpp
@@ -47,7 +47,7 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
QWidget window;
//! [create, lay out widgets and show]
- QLabel *label = new QLabel(QObject::tr("Name:"));
+ QLabel *label = new QLabel(QApplication::translate("windowlayout", "Name:"));
QLineEdit *lineEdit = new QLineEdit();
QHBoxLayout *layout = new QHBoxLayout();
@@ -55,7 +55,8 @@ int main(int argc, char *argv[])
layout->addWidget(lineEdit);
window.setLayout(layout);
//! [create, lay out widgets and show]
- window.setWindowTitle(QObject::tr("Window layout"));
+ window.setWindowTitle(
+ QApplication::translate("windowlayout", "Window layout"));
window.show();
return app.exec();
}