From 74bf5d98e37f53ca7132f1319c18f80f5cd8f43e Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Wed, 30 Jun 2010 15:20:16 +0200
Subject: [PATCH] debugger: add a simple-minded dumper for QRegion

---
 share/qtcreator/gdbmacros/gdbmacros.py  |  7 +++++++
 tests/manual/gdbdebugger/simple/app.cpp | 11 +++++++++++
 2 files changed, 18 insertions(+)

diff --git a/share/qtcreator/gdbmacros/gdbmacros.py b/share/qtcreator/gdbmacros/gdbmacros.py
index 93dccf931bc..43041b4ce78 100644
--- a/share/qtcreator/gdbmacros/gdbmacros.py
+++ b/share/qtcreator/gdbmacros/gdbmacros.py
@@ -1377,6 +1377,13 @@ def qdump__QRectF(d, item):
             d.putItem(Item(h, None, None, "h"))
 
 
+def qdump__QRegion(d, item):
+    d.putValue(" ")
+    d.putNumChild(1)
+    if d.isExpanded(item):
+        with Children(d):
+            d.putCallItem("rects", item, "rects()")
+
 def qdump__QSet(d, item):
 
     def hashDataFirstNode(value):
diff --git a/tests/manual/gdbdebugger/simple/app.cpp b/tests/manual/gdbdebugger/simple/app.cpp
index db880e4b2a3..b71114418ec 100644
--- a/tests/manual/gdbdebugger/simple/app.cpp
+++ b/tests/manual/gdbdebugger/simple/app.cpp
@@ -60,6 +60,7 @@
 #include <QtGui/QLabel>
 #include <QtGui/QPainter>
 #include <QtGui/QPainterPath>
+#include <QtGui/QRegion>
 #include <QtGui/QStandardItemModel>
 
 #include <QtNetwork/QHostAddress>
@@ -803,6 +804,15 @@ void testQPixmap()
     Q_UNUSED(i);
 }
 
+void testQRegion()
+{
+    QRegion region;
+    region += QRect(100, 100, 200, 200);
+    region += QRect(300, 300, 400, 500);
+    region += QRect(500, 500, 600, 600);
+}
+
+
 void testPlugin()
 {
     QString dir = QDir::currentPath();
@@ -1793,6 +1803,7 @@ int main(int argc, char *argv[])
     //testWCout0();
     //testWCout();
     testColor();
+    testQRegion();
     testStuff();
     testPeekAndPoke3();
     testFunctionPointer();
-- 
GitLab