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.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'src/plugins/platforms/windows/qwindowstabletsupport.cpp') diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp index 280519d39d..00561c9fa1 100644 --- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp +++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp @@ -135,9 +135,9 @@ QDebug operator<<(QDebug d, const QWindowsTabletDeviceData &t) d.nospace(); d << "TabletDevice id:" << t.uniqueId << " pressure: " << t.minPressure << ".." << t.maxPressure << " tan pressure: " << t.minTanPressure << ".." - << t.maxTanPressure << " area:" << t.minX << t.minY <createDummyWindow(QStringLiteral("TabletDummyWindow"), L"TabletDummyWindow", qWindowsTabletSupportWndProc); if (!window) { qCWarning(lcQpaTablet) << __FUNCTION__ << "Unable to create window for tablet."; - return 0; + return nullptr; } LOGCONTEXT lcMine; // build our context from the default context @@ -255,7 +252,7 @@ QWindowsTabletSupport *QWindowsTabletSupport::create() if (!context) { qCDebug(lcQpaTablet) << __FUNCTION__ << "Unable to open tablet."; DestroyWindow(window); - return 0; + return nullptr; } // Set the size of the Packet Queue to the correct size @@ -266,7 +263,7 @@ QWindowsTabletSupport *QWindowsTabletSupport::create() qWarning("Unable to set queue size on tablet. The tablet will not work."); QWindowsTabletSupport::m_winTab32DLL.wTClose(context); DestroyWindow(window); - return 0; + return nullptr; } // cannot restore old size } // cannot set } // mismatch @@ -285,7 +282,7 @@ unsigned QWindowsTabletSupport::options() const QString QWindowsTabletSupport::description() const { - const unsigned size = m_winTab32DLL.wTInfo(WTI_INTERFACE, IFC_WINTABID, 0); + const unsigned size = m_winTab32DLL.wTInfo(WTI_INTERFACE, IFC_WINTABID, nullptr); if (!size) return QString(); QVarLengthArray winTabId(size + 1); -- cgit v1.2.3