OSDN Git Service

debugger: add python dumper for QFixed
authorhjk <qtc-committer@nokia.com>
Fri, 8 Oct 2010 12:26:44 +0000 (14:26 +0200)
committerhjk <qtc-committer@nokia.com>
Fri, 8 Oct 2010 12:26:44 +0000 (14:26 +0200)
Reviewed-by: Alessandro Portale
share/qtcreator/gdbmacros/gdbmacros.py
tests/manual/gdbdebugger/simple/simple_gdbtest_app.cpp

index 6c08f19..63b7c17 100644 (file)
@@ -321,6 +321,12 @@ def qdump__QFileInfo(d, item):
             d.putCallItem("lastRead", item, "lastRead()")
 
 
+def qdump__QFixed(d, item):
+    v = int(item.value["val"])
+    d.putValue("%s/64 = %s" % (v, v/64.0))
+    d.putNumChild(0)
+
+
 def qdump__QFlags(d, item):
     #warn("QFLAGS: %s" % item.value)
     i = item.value["i"]
index b346666..3bc1b2b 100644 (file)
@@ -57,6 +57,7 @@
 #include <QtGui/QColor>
 #include <QtGui/QFont>
 #include <QtGui/QLabel>
+//#include <QtGui/private/qfixed_p.h>
 #include <QtGui/QPainter>
 #include <QtGui/QPainterPath>
 #include <QtGui/QRegion>
@@ -457,6 +458,18 @@ QFileInfo testQFileInfo()
     return result;
 }
 
+/*
+void testQFixed()
+{
+    QFixed f = QFixed::fromReal(4.2);
+    f += 1;
+    f += 1;
+    f *= -1;
+    f += 1;
+    f += 1;
+}
+*/
+
 QHash<int, float> testQHash()
 {
 #if 1
@@ -2015,6 +2028,7 @@ int main(int argc, char *argv[])
     testQDateTime();
     testQTime();
     testQFileInfo();
+    testQFixed();
     testObject1();
     testVector1();
     testQHash1();