pixeltool: Display cursor position in title bar for measurements.
authorFriedemann Kleint <Friedemann.Kleint@digia.com>
Thu, 6 Dec 2012 13:31:42 +0000 (14:31 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 6 Dec 2012 13:40:59 +0000 (14:40 +0100)
Change-Id: Ibc6d92dc9fb52989ea4d82e971cfc215d3f49f33
Reviewed-by: hjk <qthjk@ovi.com>
src/pixeltool/qpixeltool.cpp

index 95c0676..cf36fab 100644 (file)
@@ -428,6 +428,11 @@ void QPixelTool::grabScreen()
     if (mousePos == m_lastMousePos && !m_autoUpdate)
         return;
 
+    if (m_lastMousePos != mousePos) {
+        setWindowTitle(QString::fromLatin1("PixelTool [%1, %2] ")
+                       .arg(mousePos.x()).arg(mousePos.y()));
+    }
+
     int w = int(width() / float(m_zoom));
     int h = int(height() / float(m_zoom));