MCPcopy Create free account
hub / github.com/KDAB/KDChart / dumpLayoutTreeRecurse

Function dumpLayoutTreeRecurse

src/KDChart/KDChartChart.cpp:66–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66static void dumpLayoutTreeRecurse(QLayout *l, int *counter, int depth)
67{
68 const QLatin1String colorOn(isZeroArea(l->geometry()) ? "\033[0m" : "\033[32m");
69 const QLatin1String colorOff("\033[0m");
70
71 QString prolog = lineProlog(depth, *counter);
72 (*counter)++;
73
74 qDebug() << colorOn + prolog << l->metaObject()->className() << l->geometry()
75 << "hint" << l->sizeHint()
76 << l->hasHeightForWidth() << "min" << l->minimumSize()
77 << "max" << l->maximumSize()
78 << l->expandingDirections() << l->alignment()
79 << colorOff;
80 for (int i = 0; i < l->count(); i++) {
81 QLayoutItem *child = l->itemAt(i);
82 if (QLayout *childL = child->layout()) {
83 dumpLayoutTreeRecurse(childL, counter, depth + 1);
84 } else {
85 // The isZeroArea check culls usually largely useless output - you might want to remove it in
86 // some debugging situations. Add a boolean parameter to this and dumpLayoutTree() if you do.
87 if (!isZeroArea(child->geometry())) {
88 prolog = lineProlog(depth + 1, *counter);
89 (*counter)++;
90 qDebug() << colorOn + prolog << typeid(*child).name() << child->geometry()
91 << "hint" << child->sizeHint()
92 << child->hasHeightForWidth() << "min" << child->minimumSize()
93 << "max" << child->maximumSize()
94 << child->expandingDirections() << child->alignment()
95 << colorOff;
96 }
97 }
98 }
99}
100
101static void dumpLayoutTree(QLayout *l)
102{

Callers 1

dumpLayoutTreeFunction · 0.85

Calls 10

isZeroAreaFunction · 0.85
linePrologFunction · 0.85
geometryMethod · 0.45
sizeHintMethod · 0.45
hasHeightForWidthMethod · 0.45
minimumSizeMethod · 0.45
maximumSizeMethod · 0.45
expandingDirectionsMethod · 0.45
alignmentMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected