diff options
-rw-r--r-- | src/gui/kernel/qkeymapper_win.cpp | 25 | ||||
-rw-r--r-- | tests/auto/qpixmap/qpixmap.pro | 15 | ||||
-rw-r--r-- | tests/auto/qpixmap/tst_qpixmap.cpp | 9 | ||||
-rw-r--r-- | tests/auto/qwidget/tst_qwidget.cpp | 3 |
4 files changed, 44 insertions, 8 deletions
diff --git a/src/gui/kernel/qkeymapper_win.cpp b/src/gui/kernel/qkeymapper_win.cpp index 402d88e..10958f3 100644 --- a/src/gui/kernel/qkeymapper_win.cpp +++ b/src/gui/kernel/qkeymapper_win.cpp @@ -433,6 +433,23 @@ static const Qt::KeyboardModifiers ModsTbl[] = { Qt::NoModifier, // Fall-back to raw Key_* }; +/** + Remap return or action key to select key for windows mobile. +*/ +inline int winceKeyBend(int keyCode) +{ +#ifdef Q_OS_WINCE_WM + // remap return or action key to select key for windows mobile. + // will be changed to a table remapping function in the next version (4.6/7). + if (keyCode == 13) + return Qt::Key_Select; + else + return KeyTbl[keyCode]; +#else + return KeyTbl[keyCode]; +#endif +} + #if defined(Q_OS_WINCE) // Use the KeyTbl to resolve a Qt::Key out of the virtual keys. // In case it is not resolvable, continue using the virtual key itself. @@ -472,7 +489,7 @@ static inline int toKeyOrUnicode(int vk, int scancode, unsigned char *kbdBuffer, // Qt::Key_*'s are not encoded below 0x20, so try again, and DEL keys (0x7f) is encoded with a // proper Qt::Key_ code if (code < 0x20 || code == 0x7f) // Handles res==0 too - code = KeyTbl[vk]; + code = winceKeyBend(vk); if (isDeadkey) *isDeadkey = (res == -1); @@ -482,7 +499,7 @@ static inline int toKeyOrUnicode(int vk, int scancode, unsigned char *kbdBuffer, Q_GUI_EXPORT int qt_translateKeyCode(int vk) { - int code = (vk < 0 || vk > 255) ? 0 : KeyTbl[vk]; + int code = winceKeyBend((vk < 0 || vk > 255) ? 0 : vk); return code == Qt::Key_unknown ? 0 : code; } @@ -689,7 +706,7 @@ void QKeyMapperPrivate::updatePossibleKeyCodes(unsigned char *kbdBuffer, quint32 keyLayout[vk_key]->qtKey[7] = toKeyOrUnicode(vk_key, scancode, buffer, &isDeadKey); keyLayout[vk_key]->deadkeys |= isDeadKey ? 0x80 : 0; // Add a fall back key for layouts which don't do composition and show non-latin1 characters - int fallbackKey = KeyTbl[vk_key]; + int fallbackKey = winceKeyBend(vk_key); if (!fallbackKey || fallbackKey == Qt::Key_unknown) { fallbackKey = 0; if (vk_key != keyLayout[vk_key]->qtKey[0] && vk_key < 0x5B && vk_key > 0x2F) @@ -898,7 +915,7 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, const MSG &msg, bool // ..also if we're typing numbers on the keypad, while holding down the Alt modifier. int code = 0; if (isNumpad && (nModifiers & AltAny)) { - code = KeyTbl[msg.wParam]; + code = winceKeyBend(msg.wParam); } else if (!isDeadKey) { unsigned char kbdBuffer[256]; // Will hold the complete keyboard state GetKeyboardState(kbdBuffer); diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro index 31d6eaa..a3577bd 100644 --- a/tests/auto/qpixmap/qpixmap.pro +++ b/tests/auto/qpixmap/qpixmap.pro @@ -2,16 +2,23 @@ load(qttest_p4) SOURCES += tst_qpixmap.cpp contains(QT_CONFIG, qt3support): QT += qt3support wince*|symbian*: { - task31722_0.sources = convertFromImage/task31722_0/* + + task31722_0.sources = convertFromImage/task31722_0/*.png task31722_0.path = convertFromImage/task31722_0 - task31722_1.sources = convertFromImage/task31722_1/* + + task31722_1.sources = convertFromImage/task31722_1/*.png task31722_1.path = convertFromImage/task31722_1 - DEPLOYMENT += task31722_0 task31722_1 + + icons.sources = convertFromToHICON/* + icons.path = convertFromToHICON + + DEPLOYMENT += task31722_0 task31722_1 icons + DEPLOYMENT_PLUGIN += qico } wince*: { DEFINES += SRCDIR=\\\".\\\" -} symbian*: { +} else:symbian* { DEPLOYMENT_PLUGIN += qmng LIBS += -lfbscli.dll -lbitgdi.dll -lgdi.dll contains(QT_CONFIG, openvg) { diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index 8151e62..2568b94 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -1034,6 +1034,10 @@ void tst_QPixmap::toWinHICON_data() void tst_QPixmap::toWinHICON() { +#ifdef Q_OS_WINCE + QSKIP("Test shall be enabled for Windows CE shortly.", SkipAll); +#endif + QFETCH(int, width); QFETCH(int, height); QFETCH(QString, image); @@ -1074,6 +1078,10 @@ void tst_QPixmap::fromWinHICON_data() void tst_QPixmap::fromWinHICON() { +#ifdef Q_OS_WINCE + QSKIP("Test shall be enabled for Windows CE shortly.", SkipAll); + +#else QFETCH(int, width); QFETCH(int, height); QFETCH(QString, image); @@ -1090,6 +1098,7 @@ void tst_QPixmap::fromWinHICON() // QVERIFY(imageFromHICON == imageFromFile); compareImages(imageFromHICON, imageFromFile); +#endif } #endif // Q_WS_WIN diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 94e67a4..c4e62ef 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -9146,6 +9146,9 @@ void tst_QWidget::destroyBackingStore() void tst_QWidget::rectOutsideCoordinatesLimit_task144779() { +#ifdef Q_OS_WINCE_WM + QSKIP( "Tables of 5000 elements do not make sense on Windows Mobile.", SkipAll); +#endif QApplication::setOverrideCursor(Qt::BlankCursor); //keep the cursor out of screen grabs QWidget main(0,Qt::FramelessWindowHint); //don't get confused by the size of the window frame QPalette palette; |