diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-07-20 13:09:42 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-07-21 14:14:50 +0200 |
commit | 8e48184120f74c02447c8d96408c1c003cd7fd79 (patch) | |
tree | 497028e8f49aa8d2dfe8ecdfd4003eff3d538871 /src/plugins/platforms/windows/qwindowsintegration.cpp | |
parent | beab436d77476c93d50d8608c15b369044937d7f (diff) |
Start the native interface QWindowsApplication
Implement the static parts of QWindowsWindowFunctions.
Move some things around and make them static in tablet support
to make this easier.
Task-number: QTBUG-83252
Change-Id: I24c3b0b3c6548eb96c4f3285a4e46385a1e79ef5
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsintegration.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsintegration.cpp | 37 |
1 files changed, 7 insertions, 30 deletions
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index ea077bc695..aeafff9962 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -139,7 +139,6 @@ struct QWindowsIntegrationPrivate ~QWindowsIntegrationPrivate(); unsigned m_options = 0; - int m_tabletAbsoluteRange = -1; QWindowsContext m_context; QPlatformFontDatabase *m_fontDatabase = nullptr; #if QT_CONFIG(clipboard) @@ -242,16 +241,16 @@ QWindowsIntegrationPrivate::QWindowsIntegrationPrivate(const QStringList ¶mL // Default to per-monitor awareness to avoid being scaled when monitors with different DPI // are connected to Windows 8.1 QtWindows::ProcessDpiAwareness dpiAwareness = QtWindows::ProcessPerMonitorDpiAware; - m_options = parseOptions(paramList, &m_tabletAbsoluteRange, &dpiAwareness); + int tabletAbsoluteRange = -1; + m_options = parseOptions(paramList, &tabletAbsoluteRange, &dpiAwareness); QWindowsFontDatabase::setFontOptions(m_options); + if (tabletAbsoluteRange >= 0) + QWindowsContext::setTabletAbsoluteRange(tabletAbsoluteRange); - if (m_context.initPointer(m_options)) { + if (m_context.initPointer(m_options)) QCoreApplication::setAttribute(Qt::AA_CompressHighFrequencyEvents); - } else { - m_context.initTablet(m_options); - if (m_tabletAbsoluteRange >= 0) - m_context.setTabletAbsoluteRange(m_tabletAbsoluteRange); - } + else + m_context.initTablet(); if (!dpiAwarenessSet) { // Set only once in case of repeated instantiations of QGuiApplication. if (!QCoreApplication::testAttribute(Qt::AA_PluginApplication)) { @@ -650,28 +649,6 @@ void QWindowsIntegration::beep() const MessageBeep(MB_OK); // For QApplication } -bool QWindowsIntegration::setWinTabEnabled(bool enabled) -{ - bool ret = false; - if (QWindowsIntegration *p = QWindowsIntegration::instance()) { - if (enabled) { - if (p->d->m_context.tabletSupport()) { - ret = true; - } else { - ret = p->d->m_context.initTablet(p->d->m_options); - if (ret && p->d->m_tabletAbsoluteRange >= 0) - p->d->m_context.setTabletAbsoluteRange(p->d->m_tabletAbsoluteRange); - } - } else { - if (p->d->m_context.tabletSupport()) - ret = p->d->m_context.disposeTablet(); - else - ret = true; - } - } - return ret; -} - #if QT_CONFIG(vulkan) QPlatformVulkanInstance *QWindowsIntegration::createPlatformVulkanInstance(QVulkanInstance *instance) const { |