Commit c992a9ff authored by hjk's avatar hjk
Browse files

Debugger: Add dumpers for QPolygon{,F} and QGraphicsPolygonItem



Change-Id: Ic246b28d44312a677c8d41194d4e0c324bda125d
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 5b98fcf7
......@@ -1715,6 +1715,21 @@ def qform__QStack():
def qdump__QStack(d, value):
qdump__QVector(d, value)
def qdump__QPolygonF(d, value):
qdump__QVector(d, value.cast(d.directBaseClass(value.type, 0)))
d.putBetterType(d.currentType)
def qdump__QPolygon(d, value):
qdump__QVector(d, value.cast(d.directBaseClass(value.type, 0)))
d.putBetterType(d.currentType)
def qdump__QGraphicsPolygonItem(d, value):
dptr = d.extractPointer(d.addressOf(value) + d.ptrSize()) # Skip vtable
# Assume sizeof(QGraphicsPolygonItemPrivate) == 400
offset = 308 if d.is32bit() else 384
data, size, alloc = d.vectorDataHelper(d.extractPointer(dptr + offset))
d.putItemCount(size)
d.putPlotData(data, size, d.lookupQtType("QPointF"))
def qdump__QStandardItem(d, value):
d.putBetterType(d.currentType)
......
......@@ -5768,6 +5768,23 @@ void tst_Dumpers::dumper_data()
+ Check("u32", "68", "uint32_t")
+ Check("s32", "69", "int32_t");
QTest::newRow("QPolygon")
<< Data("#include <QGraphicsScene>\n"
"#include <QGraphicsPolygonItem>\n"
"#include <QApplication>\n",
"QApplication app(argc, argv);\n"
"QGraphicsScene sc;\n"
"QPolygonF pol;\n"
"pol.append(QPointF(1, 2));\n"
"pol.append(QPointF(2, 2));\n"
"pol.append(QPointF(3, 3));\n"
"pol.append(QPointF(2, 4));\n"
"pol.append(QPointF(1, 4));\n"
"QGraphicsPolygonItem *p = sc.addPolygon(pol);\n"
"unused(&p);\n")
+ GuiProfile()
+ Check("pol", "<5 items>", "@QPolygonF")
+ Check("p", "<5 items>", "@QGraphicsPolygonItem");
}
int main(int argc, char *argv[])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment