From 6a20960cad7f979e4fb31b649245390f936c1847 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 20 Aug 2009 10:10:01 +0200 Subject: [PATCH] add dumper for QRect --- share/qtcreator/gdbmacros/gdbmacros.cpp | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/share/qtcreator/gdbmacros/gdbmacros.cpp b/share/qtcreator/gdbmacros/gdbmacros.cpp index 497e25b7834..20479187825 100644 --- a/share/qtcreator/gdbmacros/gdbmacros.cpp +++ b/share/qtcreator/gdbmacros/gdbmacros.cpp @@ -2561,6 +2561,26 @@ static void qDumpQPixmap(QDumper &d) } #endif +#ifndef QT_BOOTSTRAPPED +static void qDumpQRect(QDumper &d) +{ + const QRect &rc = *reinterpret_cast(d.data); + d.beginItem("value"); + d.put("(").put(rc.width()).put("x").put(rc.height()); + if (rc.x() > 0) + d.put("+"); + d.put(rc.x()); + if (rc.y() > 0) + d.put("+"); + d.put(rc.y()); + d.put(")"); + d.endItem(); + d.putItem("type", NS"QRect"); + d.putItem("numchild", "4"); + d.disarm(); +} +#endif + static void qDumpQSet(QDumper &d) { // This uses the knowledge that QHash has only a single member @@ -3269,6 +3289,12 @@ static void handleProtocolVersion2and3(QDumper & d) qDumpQPixmap(d); #endif break; + case 'R': + #ifndef QT_BOOTSTRAPPED + if (isEqual(type, "QRect")) + qDumpQRect(d); + #endif + break; case 'S': if (isEqual(type, "QString")) qDumpQString(d); @@ -3446,6 +3472,7 @@ void *qDumpObjectData440( "\""NS"QObjectSlot\"," "\""NS"QObjectSlotList\"," "\""NS"QObjectChildList\"," + "\""NS"QRect\"," //"\""NS"QRegion\"," "\""NS"QSet\"," "\""NS"QString\","