summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qtranslator.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2020-04-14 09:59:14 +0200
committerKai Koehne <kai.koehne@qt.io>2020-05-05 08:33:31 +0200
commitec2ac17c10416d4f5a265f9899b8012d3bebea01 (patch)
tree1cdd5c17b50999cc7ace9cb3cb2a75c0c7b1022e /src/corelib/kernel/qtranslator.cpp
parent8f7e21bc509d6743c6a0ed6c86373890d4e17530 (diff)
Improve QTranslator documentation code snippet
Use :/i18n/, because this is the place where translations are stored by default if using qmake's CONFIG += lrelease embed_translations. Also revert change of app.exec() done in 16da0b2cf8b6b. First of all, both QGuiApplication and QApplication feature overloads of exec(), so using QCoreApplication::exec() might miss functionality. Anyhow, while it's true that all of them are static member functions, the vast majority of our examples and templates call them with class member access syntax, so let's try to be consistent. Finally, the example since a while uses QCoreApplication::translate, not tr(), so let's not mention it in the description. Change-Id: Ic6e5d91cf04d3f0d1a4296c5c09e790773e6fc62 Reviewed-by: MiƂosz Kosobucki <milosz@kosobucki.pl> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/corelib/kernel/qtranslator.cpp')
-rw-r--r--src/corelib/kernel/qtranslator.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index 2205366696..d7d670b5bc 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