summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowskeymapper.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-02-20 01:01:00 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2019-02-20 09:51:12 +0100
commit035f934d7a798e97bf0213a5d42a3d511132f03d (patch)
tree89aa6efdc86864ce479cddca6b9c4ba523c2754a /src/plugins/platforms/windows/qwindowskeymapper.cpp
parentf4cc23cffbe3005f0a522cac938695e87ecd6407 (diff)
parentda4ab444ffac37514435364d4d3f0ad59d4f9bc3 (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts: tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp Added tests/auto/testlib/selftests/expected_crashes_5.txt to work round the output of the crashes test (which exercises UB, see QTBUG-73903) being truncated on one test platform. Change-Id: I9cd3f2639b4e50c3c4513e14629a40bdca8f8273
Diffstat (limited to 'src/plugins/platforms/windows/qwindowskeymapper.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index 96abfdb9d7..c050369801 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -97,7 +97,7 @@ QT_BEGIN_NAMESPACE
static void clearKeyRecorderOnApplicationInActive(Qt::ApplicationState state);
QWindowsKeyMapper::QWindowsKeyMapper()
- : m_useRTLExtensions(false), m_keyGrabber(0)
+ : m_useRTLExtensions(false), m_keyGrabber(nullptr)
{
memset(keyLayout, 0, sizeof(keyLayout));
QGuiApplication *app = static_cast<QGuiApplication *>(QGuiApplication::instance());
@@ -162,7 +162,7 @@ static void clearKeyRecorderOnApplicationInActive(Qt::ApplicationState state)
KeyRecord *KeyRecorder::findKey(int code, bool remove)
{
- KeyRecord *result = 0;
+ KeyRecord *result = nullptr;
for (int i = 0; i < nrecs; ++i) {
if (records[i].code == code) {
if (remove) {
@@ -605,7 +605,7 @@ inline quint32 winceKeyBend(quint32 keyCode)
}
// Translate a VK into a Qt key code, or unicode character
-static inline quint32 toKeyOrUnicode(quint32 vk, quint32 scancode, unsigned char *kbdBuffer, bool *isDeadkey = 0)
+static inline quint32 toKeyOrUnicode(quint32 vk, quint32 scancode, unsigned char *kbdBuffer, bool *isDeadkey = nullptr)
{
Q_ASSERT(vk > 0 && vk < 256);
quint32 code = 0;
@@ -822,7 +822,7 @@ static void showSystemMenu(QWindow* w)
TPM_LEFTALIGN | TPM_TOPALIGN | TPM_NONOTIFY | TPM_RETURNCMD,
pos.x(), pos.y(),
topLevelHwnd,
- 0);
+ nullptr);
if (ret)
qWindowsWndProc(topLevelHwnd, WM_SYSCOMMAND, WPARAM(ret), 0);
}
@@ -1023,13 +1023,15 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, MSG msg,
if (dirStatus == VK_LSHIFT
&& ((msg.wParam == VK_SHIFT && GetKeyState(VK_LCONTROL))
|| (msg.wParam == VK_CONTROL && GetKeyState(VK_LSHIFT)))) {
- sendExtendedPressRelease(receiver, Qt::Key_Direction_L, 0, scancode, vk_key, nModifiers, QString(), false);
+ sendExtendedPressRelease(receiver, Qt::Key_Direction_L, nullptr,
+ scancode, vk_key, nModifiers, QString(), false);
result = true;
dirStatus = 0;
} else if (dirStatus == VK_RSHIFT
&& ( (msg.wParam == VK_SHIFT && GetKeyState(VK_RCONTROL))
|| (msg.wParam == VK_CONTROL && GetKeyState(VK_RSHIFT)))) {
- sendExtendedPressRelease(receiver, Qt::Key_Direction_R, 0, scancode, vk_key, nModifiers, QString(), false);
+ sendExtendedPressRelease(receiver, Qt::Key_Direction_R, nullptr,
+ scancode, vk_key, nModifiers, QString(), false);
result = true;
dirStatus = 0;
} else {
@@ -1140,7 +1142,7 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, MSG msg,
// This will stop the auto-repeat of the key, should a modifier change, for example
if (rec && rec->state != state) {
key_recorder.findKey(int(msg.wParam), true);
- rec = 0;
+ rec = nullptr;
}
// Find unicode character from Windows Message Queue
@@ -1150,7 +1152,7 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, MSG msg,
: msgType == WM_IME_KEYDOWN ? WM_IME_CHAR : WM_SYSCHAR);
QChar uch;
- if (PeekMessage(&wm_char, 0, charType, charType, PM_REMOVE)) {
+ if (PeekMessage(&wm_char, nullptr, charType, charType, PM_REMOVE)) {
if (QWindowsContext::filterNativeEvent(&wm_char, lResult))
return true;
if (receiver && QWindowsContext::filterNativeEvent(receiver, &wm_char, lResult))