summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/kernel/qkeysequence
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2017-03-03 16:58:52 -0800
committerJake Petroules <jake.petroules@qt.io>2017-03-07 01:04:40 +0000
commitc1058cfd7b713ce91938439ab5bf945fd46dc803 (patch)
tree05027e8eac12894e528b9a83aa96a53db821e9cd /tests/auto/gui/kernel/qkeysequence
parente0e956bfc2cb418ca95e06f3f0f4d863a518fc6b (diff)
Remove remaining Carbon includes from QtCore, QtGui and QtWidgets
Carbon is deprecated and we should not rely on it at runtime or compile time. These headers were only included for a small collection of keyboard key constants which have now been hardcoded instead. Change-Id: Ia2eaa267584b63be8019be3bbf64cba897a985a8 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Diffstat (limited to 'tests/auto/gui/kernel/qkeysequence')
-rw-r--r--tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp
index 6394a956bd..f8b6bf064a 100644
--- a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp
+++ b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp
@@ -36,14 +36,18 @@
#include <QLibraryInfo>
#ifdef Q_OS_MAC
-#ifdef Q_OS_OSX
-#include <Carbon/Carbon.h>
-#endif
struct MacSpecialKey {
int key;
ushort macSymbol;
};
+// Unicode code points for the glyphs associated with these keys
+// Defined by Carbon headers but not anywhere in Cocoa
+static const int kShiftUnicode = 0x21E7;
+static const int kControlUnicode = 0x2303;
+static const int kOptionUnicode = 0x2325;
+static const int kCommandUnicode = 0x2318;
+
static const int NumEntries = 21;
static const MacSpecialKey entries[NumEntries] = {
{ Qt::Key_Escape, 0x238B },
@@ -61,12 +65,10 @@ static const MacSpecialKey entries[NumEntries] = {
{ Qt::Key_Down, 0x2193 },
{ Qt::Key_PageUp, 0x21DE },
{ Qt::Key_PageDown, 0x21DF },
-#ifdef Q_OS_OSX
{ Qt::Key_Shift, kShiftUnicode },
{ Qt::Key_Control, kCommandUnicode },
{ Qt::Key_Meta, kControlUnicode },
{ Qt::Key_Alt, kOptionUnicode },
-#endif
{ Qt::Key_CapsLock, 0x21EA },
};