diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-07-01 14:37:29 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-07-03 07:39:14 +0200 |
commit | 3fb31819fd4a209873ef671494cba8bd95dae73a (patch) | |
tree | a61b064804d5b2d7010b83cb17f31983885e8a38 /src/plugins/platforms/windows/qwindowspointerhandler.h | |
parent | 39d99c714bb87bd39e92d85fb1f46c52eb9f8d33 (diff) |
Windows QPA: Refactor touch device creation
There was duplicated code in QWindowsMouseHandler::ensureTouchDevice() and
QWindowsPointerHandler::ensureTouchDevice() which caused deprecation
warnings since the setters of QInputDevice were deprecated.
Join the 2 functions into a single creation function and add simple getters
and setters.
Fix deprecation warnings:
qwindowscontext.cpp:357:108: warning: 'void
QPointingDevice::setCapabilities(QInputDevice::Capabilities)' is deprecated: Use the constructor
qwindowsmousehandler.cpp:132:97: warning: 'void QPointingDevice::setType(QInputDevice::DeviceType)' is deprecated: Use the constructor
qwindowsmousehandler.cpp:136:41: warning: 'void QPointingDevice::setCapabilities(QInputDevice::Capabilities)' is deprecated: Use the constructor
qwindowsmousehandler.cpp:137:49: warning: 'void QPointingDevice::setMaximumTouchPoints(int)' is deprecated: Use the constructor
Change-Id: Iab5385e84d600e45b60f38225175f25ef043c3eb
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowspointerhandler.h')
-rw-r--r-- | src/plugins/platforms/windows/qwindowspointerhandler.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowspointerhandler.h b/src/plugins/platforms/windows/qwindowspointerhandler.h index d232941ba5..3b204c675b 100644 --- a/src/plugins/platforms/windows/qwindowspointerhandler.h +++ b/src/plugins/platforms/windows/qwindowspointerhandler.h @@ -61,8 +61,11 @@ public: ~QWindowsPointerHandler(); bool translatePointerEvent(QWindow *window, HWND hwnd, QtWindows::WindowsEventType et, MSG msg, LRESULT *result); bool translateMouseEvent(QWindow *window, HWND hwnd, QtWindows::WindowsEventType et, MSG msg, LRESULT *result); + QPointingDevice *touchDevice() const { return m_touchDevice; } - QPointingDevice *ensureTouchDevice(); + void setTouchDevice(QPointingDevice *d) { m_touchDevice = d; } + static QPointingDevice *createTouchDevice(bool mouseEmulation); + QWindow *windowUnderMouse() const { return m_windowUnderPointer.data(); } void clearWindowUnderMouse() { m_windowUnderPointer = nullptr; } void clearEvents(); |