diff options
author | Maximilian Goldstein <max.goldstein@qt.io> | 2022-02-09 18:09:34 +0100 |
---|---|---|
committer | Maximilian Goldstein <max.goldstein@qt.io> | 2022-02-14 12:38:10 +0100 |
commit | 0f0987c16011b3485ed99660e8c83e3d75d01fd0 (patch) | |
tree | fd52af2398114b86dc8ffafe35e4aec26c5de30f /tests/auto/qml/qqmlvaluetypes | |
parent | 4f50697e6cf5c00febda5f54e88ab5de2610c57b (diff) |
QtQuick: Add proper QInputMethod singleton
Allow for accessing QInputMethod via a singleton instead of
Qt.inputMethod
[ChangeLog][QtQuick][New Feature] Qt.inputMethod can now also be
accessed via the InputMethod singleton. This allows you to use
QInputMethod in a way supported by tooling and the compiler.
Fixes: QTBUG-95540
Change-Id: I3366757a1253b202f1fe5320e54c96b70e3b273b
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlvaluetypes')
-rw-r--r-- | tests/auto/qml/qqmlvaluetypes/data/locale_read_singleton.qml | 21 | ||||
-rw-r--r-- | tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp | 5 |
2 files changed, 24 insertions, 2 deletions
diff --git a/tests/auto/qml/qqmlvaluetypes/data/locale_read_singleton.qml b/tests/auto/qml/qqmlvaluetypes/data/locale_read_singleton.qml new file mode 100644 index 0000000000..f56fe3f422 --- /dev/null +++ b/tests/auto/qml/qqmlvaluetypes/data/locale_read_singleton.qml @@ -0,0 +1,21 @@ +import QtQuick + +Item { + property string amText: InputMethod.locale.amText + property string decimalPoint: InputMethod.locale.decimalPoint + property string exponential: InputMethod.locale.exponential + property int firstDayOfWeek: InputMethod.locale.firstDayOfWeek + property string groupSeparator: InputMethod.locale.groupSeparator + property int measurementSystem: InputMethod.locale.measurementSystem + property string name: InputMethod.locale.name + property string nativeCountryName: InputMethod.locale.nativeCountryName + property string nativeLanguageName: InputMethod.locale.nativeLanguageName + property string negativeSign: InputMethod.locale.negativeSign + property string percent: InputMethod.locale.percent + property string pmText: InputMethod.locale.pmText + property string positiveSign: InputMethod.locale.positiveSign + property int textDirection: InputMethod.locale.textDirection + property var uiLanguages: InputMethod.locale.uiLanguages + property var weekDays: InputMethod.locale.weekDays + property string zeroDigit: InputMethod.locale.zeroDigit +} diff --git a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp index 38e1e585ce..a61a632d24 100644 --- a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp +++ b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp @@ -295,8 +295,9 @@ void tst_qqmlvaluetypes::sizef() void tst_qqmlvaluetypes::locale() { - { - QQmlComponent component(&engine, testFileUrl("locale_read.qml")); + for (const QUrl &testFile : + { testFileUrl("locale_read.qml"), testFileUrl("locale_read_singleton.qml") }) { + QQmlComponent component(&engine, testFile); QScopedPointer<QObject> object(component.create()); QVERIFY(!object.isNull()); |