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/qwindowsscreen.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/qwindowsscreen.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsscreen.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp index 60c8bee286..a6e2aabaf0 100644 --- a/src/plugins/platforms/windows/qwindowsscreen.cpp +++ b/src/plugins/platforms/windows/qwindowsscreen.cpp @@ -241,8 +241,7 @@ QWindow *QWindowsScreen::findTopLevelAt(const QPoint &point, unsigned flags) if (QPlatformWindow *bw = QWindowsContext::instance()-> findPlatformWindowAt(GetDesktopWindow(), point, flags)) result = QWindowsWindow::topLevelOf(bw->window()); - if (QWindowsContext::verboseWindows) - qDebug() << __FUNCTION__ << point << flags << result; + qCDebug(lcQpaWindows) <<__FUNCTION__ << point << flags << result; return result; } @@ -252,8 +251,7 @@ QWindow *QWindowsScreen::windowAt(const QPoint &screenPoint, unsigned flags) if (QPlatformWindow *bw = QWindowsContext::instance()-> findPlatformWindowAt(GetDesktopWindow(), screenPoint, flags)) result = bw->window(); - if (QWindowsContext::verboseWindows) - qDebug() << __FUNCTION__ << screenPoint << " returns " << result; + qCDebug(lcQpaWindows) <<__FUNCTION__ << screenPoint << " returns " << result; return result; } @@ -364,9 +362,8 @@ bool QWindowsScreenManager::handleDisplayChange(WPARAM wParam, LPARAM lParam) m_lastDepth = newDepth; m_lastHorizontalResolution = newHorizontalResolution; m_lastVerticalResolution = newVerticalResolution; - if (QWindowsContext::verboseWindows) - qDebug("%s: Depth=%d, resolution=%hux%hu", - __FUNCTION__, newDepth, newHorizontalResolution, newVerticalResolution); + qCDebug(lcQpaWindows) << __FUNCTION__ << "Depth=" << newDepth + << ", resolution " << newHorizontalResolution << 'x' << newVerticalResolution; handleScreenChanges(); } return false; @@ -408,8 +405,7 @@ bool QWindowsScreenManager::handleScreenChanges() QWindowsScreen *newScreen = new QWindowsScreen(newData); m_screens.push_back(newScreen); QWindowsIntegration::instance()->emitScreenAdded(newScreen); - if (QWindowsContext::verboseWindows) - qDebug() << "New Monitor: " << newData; + qCDebug(lcQpaWindows) << "New Monitor: " << newData; } // exists } // for new screens. // Remove deleted ones but keep main monitors if we get only the @@ -417,8 +413,7 @@ bool QWindowsScreenManager::handleScreenChanges() if (!lockScreen) { for (int i = m_screens.size() - 1; i >= 0; --i) { if (indexOfMonitor(newDataList, m_screens.at(i)->data().name) == -1) { - if (QWindowsContext::verboseWindows) - qDebug() << "Removing Monitor: " << m_screens.at(i) ->data(); + qCDebug(lcQpaWindows) << "Removing Monitor: " << m_screens.at(i) ->data(); delete m_screens.takeAt(i); } // not found } // for existing screens |