summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/kernel
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-05-06 09:07:18 +0200
committerLiang Qi <liang.qi@qt.io>2016-05-06 15:36:44 +0200
commitdbef41f43ece97d8ac4d6b63f7a36afcb7e7b7f7 (patch)
tree334ebaec198a7f31d1e3a4639c70fbb8bb116af2 /tests/auto/gui/kernel
parent52d30e2850769d589772576e4714a14241c7da6e (diff)
parentf57d8f1341587e6b2aa84b8404aa218432584206 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: examples/qtestlib/tutorial5/containers.cpp examples/widgets/tools/tools.pro src/corelib/io/qprocess.cpp src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/network/kernel/qdnslookup_unix.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp tools/configure/configureapp.cpp Change-Id: I838ae7f082535a67a4a53aa13a21ba5580758be8
Diffstat (limited to 'tests/auto/gui/kernel')
-rw-r--r--tests/auto/gui/kernel/qkeyevent/tst_qkeyevent.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/auto/gui/kernel/qkeyevent/tst_qkeyevent.cpp b/tests/auto/gui/kernel/qkeyevent/tst_qkeyevent.cpp
index db0bfaf622..811a6d111f 100644
--- a/tests/auto/gui/kernel/qkeyevent/tst_qkeyevent.cpp
+++ b/tests/auto/gui/kernel/qkeyevent/tst_qkeyevent.cpp
@@ -116,6 +116,23 @@ static bool orderByModifier(const QVector<int> &v1, const QVector<int> &v2)
return true;
}
+static QByteArray modifiersTestRowName(const QString &keySequence)
+{
+ QByteArray result;
+ QTextStream str(&result);
+ for (int i = 0, size = keySequence.size(); i < size; ++i) {
+ const QChar &c = keySequence.at(i);
+ const ushort uc = c.unicode();
+ if (uc > 32 && uc < 128)
+ str << '"' << c << '"';
+ else
+ str << "U+" << hex << uc << dec;
+ if (i < size - 1)
+ str << ',';
+ }
+ return result;
+}
+
void tst_QKeyEvent::modifiers_data()
{
struct Modifier
@@ -155,7 +172,8 @@ void tst_QKeyEvent::modifiers_data()
mods |= modifier.modifier;
}
QKeySequence keySequence(keys[0], keys[1], keys[2], keys[3]);
- QTest::newRow(keySequence.toString(QKeySequence::NativeText).toUtf8().constData()) << mods;
+ QTest::newRow(modifiersTestRowName(keySequence.toString(QKeySequence::NativeText)).constData())
+ << mods;
}
}