From 48cca518dfa1feff03572550068c9a50a5051830 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 13 Mar 2018 12:42:24 +0100 Subject: Windows QPA: Refactor the tablet code - Port to C++ 11: - Use member initialization for QWindowsTabletDeviceData - Use nullptr - Fix the debug operator for QWindowsTabletDeviceData Change-Id: I6ed1141d7064a4ea2717d36ec0bb2dceea857d46 Reviewed-by: Shawn Rutledge --- .../platforms/windows/qwindowstabletsupport.h | 31 +++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'src/plugins/platforms/windows/qwindowstabletsupport.h') diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.h b/src/plugins/platforms/windows/qwindowstabletsupport.h index 340818c3f7..0075216d8e 100644 --- a/src/plugins/platforms/windows/qwindowstabletsupport.h +++ b/src/plugins/platforms/windows/qwindowstabletsupport.h @@ -83,22 +83,23 @@ struct QWindowsWinTab32DLL struct QWindowsTabletDeviceData { - QWindowsTabletDeviceData() : minPressure(0), maxPressure(0), minTanPressure(0), - maxTanPressure(0), minX(0), maxX(0), minY(0), maxY(0), minZ(0), maxZ(0), - uniqueId(0), currentDevice(0), currentPointerType(0) {} - QPointF scaleCoordinates(int coordX, int coordY,const QRect &targetArea) const; qreal scalePressure(qreal p) const { return p / qreal(maxPressure - minPressure); } qreal scaleTangentialPressure(qreal p) const { return p / qreal(maxTanPressure - minTanPressure); } - int minPressure; - int maxPressure; - int minTanPressure; - int maxTanPressure; - int minX, maxX, minY, maxY, minZ, maxZ; - qint64 uniqueId; - int currentDevice; - int currentPointerType; + int minPressure = 0; + int maxPressure = 0; + int minTanPressure = 0; + int maxTanPressure = 0; + int minX = 0; + int maxX = 0; + int minY = 0; + int maxY = 0; + int minZ = 0; + int maxZ = 0; + qint64 uniqueId = 0; + int currentDevice = 0; + int currentPointerType = 0; }; #ifndef QT_NO_DEBUG_STREAM @@ -145,10 +146,10 @@ private: static QWindowsWinTab32DLL m_winTab32DLL; const HWND m_window; const HCTX m_context; - int m_absoluteRange; - bool m_tiltSupport; + int m_absoluteRange = 20; + bool m_tiltSupport = false; QVector m_devices; - int m_currentDevice; + int m_currentDevice = -1; QPointF m_oldGlobalPosF; Mode m_mode = PenMode; State m_state = PenUp; -- cgit v1.2.3