diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-23 13:06:38 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-26 16:57:00 +0100 |
commit | d3423e2d20272809b9ba1263762819543446cbe9 (patch) | |
tree | c3bda6e4323bdfdbc06f60b6e4f5b630ddf9430c /tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp | |
parent | e43a4854edbebf676c58d60716541ecc0493592f (diff) |
Fix some compiler warnings in tests
Use char16_t instead of quint16 for arrays of 16bit strings.
Use QKeyCombination API.
As a drive-by, remove superfluous 0 from characters specified in
hexadecimal.
Change-Id: Ic52b1fdceaf3348a9b81c40814031e9c2e557dd9
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp')
-rw-r--r-- | tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp index f732c4bbd1..41538896d2 100644 --- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp +++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp @@ -274,12 +274,8 @@ void tst_qquicktextedit::simulateKeys(QWindow *window, const QList<Key> &keys) void tst_qquicktextedit::simulateKeys(QWindow *window, const QKeySequence &sequence) { - for (int i = 0; i < sequence.count(); ++i) { - const int key = sequence[i]; - const int modifiers = key & Qt::KeyboardModifierMask; - - QTest::keyClick(window, Qt::Key(key & ~modifiers), Qt::KeyboardModifiers(modifiers)); - } + for (int i = 0; i < sequence.count(); ++i) + QTest::keyClick(window, sequence[i].key(), sequence[i].keyboardModifiers()); } QList<Key> &operator <<(QList<Key> &keys, const QKeySequence &sequence) @@ -1606,7 +1602,7 @@ void tst_qquicktextedit::isRightToLeft_data() QTest::addColumn<bool>("midString"); QTest::addColumn<bool>("endString"); - const quint16 arabic_str[] = { 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0647}; + const char16_t arabic_str[] = { 0x0638, 0x0643, 0x0646, 0x0647, 0x0633, 0x0638, 0x0643, 0x0646, 0x0647, 0x0633, 0x0647}; QTest::newRow("Empty") << "" << false << false << false << false << false << false << false; QTest::newRow("Neutral") << "23244242" << false << false << false << false << false << false << false; QTest::newRow("LTR") << "Hello world" << false << false << false << false << false << false << false; |