aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlengine.h
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2023-04-19 14:57:13 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2023-04-24 22:22:13 +0200
commit59567e25f6d4fbab3f0aecb5f0ff1c1978cce681 (patch)
treee066f50f0448de2aa38c22dd076f1d792cde3db6 /src/qml/qml/qqmlengine.h
parent7a3bd96a24ebb37ab3f6238fc2825120debbe003 (diff)
QQmlEngine: Introduce markCurrentFunctionAsTranslationBinding
The general recommendation to handle language changes in QML is to handle the LanguageChange event. However, if one is willing to tie themselves to the QQmlEngine, we can offer a way to ensure that calling a function will result in a traslation binding. This might also be helpful for anyone implementing a translation system different from Qt's, e.g. KDE's i18n. Fixes: QTBUG-102393 Change-Id: Id4d7a401e0be9d65e1769c8471b26689f44bf66a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlengine.h')
-rw-r--r--src/qml/qml/qqmlengine.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlengine.h b/src/qml/qml/qqmlengine.h
index a8b19e41c6..9c20090613 100644
--- a/src/qml/qml/qqmlengine.h
+++ b/src/qml/qml/qqmlengine.h
@@ -123,6 +123,8 @@ public:
bool outputWarningsToStandardError() const;
void setOutputWarningsToStandardError(bool);
+ void markCurrentFunctionAsTranslationBinding();
+
template<typename T>
T singletonInstance(int qmlTypeId);