summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-05-05 19:51:50 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-05-05 19:51:50 +0200
commit025e88bfe5b2345dd09c173dc28a9d9a45ed11de (patch)
tree0180b9123e479d7114b1caf2022dd8ff69162a17 /src/corelib
parentae7e701074be97130aa45f780e2456981850b432 (diff)
parent538223d10d133d23133db1ec7a50cb2775aca657 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/doc/snippets/hellotrmain.cpp6
-rw-r--r--src/corelib/kernel/qtranslator.cpp5
2 files changed, 6 insertions, 5 deletions
diff --git a/src/corelib/doc/snippets/hellotrmain.cpp b/src/corelib/doc/snippets/hellotrmain.cpp
index 721a83240b..526da44701 100644
--- a/src/corelib/doc/snippets/hellotrmain.cpp
+++ b/src/corelib/doc/snippets/hellotrmain.cpp
@@ -54,15 +54,15 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
QTranslator translator;
- // look up e.g. :/translations/myapp_de.qm
- if (translator.load(QLocale(), QLatin1String("myapp"), QLatin1String("_"), QLatin1String(":/translations")))
+ // look up e.g. :/i18n/myapp_de.qm
+ if (translator.load(QLocale(), QLatin1String("myapp"), QLatin1String("_"), QLatin1String(":/i18n")))
QCoreApplication::installTranslator(&translator);
QPushButton hello(QCoreApplication::translate("main", "Hello world!"));
hello.resize(100, 30);
hello.show();
- return QCoreApplication::exec();
+ return app.exec();
}
//! [0]
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index 5767d52f6a..cc6e89e0d7 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -341,8 +341,9 @@ public:
Translation files are created using \l{Qt Linguist}.
The most common use of QTranslator is to: load a translation
- file, install it using QCoreApplication::installTranslator(), and use
- it via QObject::tr(). Here's an example \c main() function using the
+ file, and install it using QCoreApplication::installTranslator().
+
+ Here's an example \c main() function using the
QTranslator:
\snippet hellotrmain.cpp 0