diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-01-10 17:17:12 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-22 12:12:17 +0100 |
commit | db51ffc0d1fbce85fd542403812fab8783c53e3c (patch) | |
tree | 2e7a051dbf6701b477e4c19de014a44dbaf84c37 /src/plugins/platforms/windows/qwindowsintegration.cpp | |
parent | a5c288ea5675a382edf0b3ecae42f461a22a7303 (diff) |
Port Windows QPA plugin to new logger API.
Introduce logging categories and change most debug statements
to qCDebug().
Retrieve the filter rules from the environment variable
QT_QPA_VERBOSE (should be removed once the logging framework
offers a more convenient way of configuring).
Replace the old per-category variables controlling verboseness
of the output by a single variable which can be set on the command
line.
Change-Id: Iae55ecdb0e150efd165b7d3e90b371f72853f194
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsintegration.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsintegration.cpp | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 5ff1fbaa44..0c46e0092a 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -175,6 +175,8 @@ static inline unsigned parseOptions(const QStringList ¶mList) options |= QWindowsIntegration::DisableArb; } else if (param == QLatin1String("nomousefromtouch")) { options |= QWindowsIntegration::DontPassOsMouseEventsSynthesizedFromTouch; + } else if (param.startsWith(QLatin1String("verbose="))) { + QWindowsContext::verbose = param.right(param.size() - 8).toInt(); } } return options; @@ -244,17 +246,14 @@ QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) cons const QWindowsWindow::WindowData obtained = QWindowsWindow::WindowData::create(window, requested, window->title()); - if (QWindowsContext::verboseWindows) - qDebug().nospace() - << __FUNCTION__ << '<' << window << '\n' - << " Requested: " << requested.geometry << "frame incl.: " - << QWindowsGeometryHint::positionIncludesFrame(window) - << " Flags=" - << QWindowsWindow::debugWindowFlags(requested.flags) << '\n' - << " Obtained : " << obtained.geometry << " Margins " - << obtained.frame << " Flags=" - << QWindowsWindow::debugWindowFlags(obtained.flags) - << " Handle=" << obtained.hwnd << '\n'; + qCDebug(lcQpaWindows).nospace() + << __FUNCTION__ << '<' << window + << "\n Requested: " << requested.geometry << "frame incl.: " + << QWindowsGeometryHint::positionIncludesFrame(window) + << " Flags=" << QWindowsWindow::debugWindowFlags(requested.flags) + << "\n Obtained : " << obtained.geometry << " Margins "<< obtained.frame + << " Flags=" << QWindowsWindow::debugWindowFlags(obtained.flags) + << " Handle=" << obtained.hwnd << '\n'; if (!obtained.hwnd) return 0; if (requested.flags != obtained.flags) @@ -269,8 +268,7 @@ QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) cons QPlatformOpenGLContext *QWindowsIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const { - if (QWindowsContext::verboseGL) - qDebug() << __FUNCTION__ << context->format(); + qCDebug(lcQpaGl) << __FUNCTION__ << context->format(); #ifdef QT_OPENGL_ES_2 if (d->m_staticEGLContext.isNull()) { QWindowsEGLStaticContext *staticContext = QWindowsEGLStaticContext::create(); @@ -324,9 +322,7 @@ QPlatformFontDatabase *QWindowsIntegration::fontDatabase() const d->m_fontDatabase = new QWindowsFontDatabase; #else if (isQMLApplication()) { - if (QWindowsContext::verboseFonts) { - qDebug() << "QML application detected, using FreeType rendering"; - } + qCDebug(lcQpaFonts) << "QML application detected, using FreeType rendering"; d->m_fontDatabase = new QWindowsFontDatabaseFT; } else |