Skip to content

Commit

Permalink
Debug|UI|Client: Debug code for printing the widget tree
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jul 24, 2016
1 parent 1774976 commit af0c74c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions doomsday/apps/client/src/ui/clientwindow.cpp
Expand Up @@ -326,6 +326,33 @@ DENG2_PIMPL(ClientWindow)
.setLeftTop(*cursorX, *cursorY);
cursor->hide();
root.add(cursor);

/*
#ifdef DENG2_DEBUG
auto debugPrint = [] (Widget &w)
{
int depth = 0;
for (auto *p = w.parent(); p; p = p->parent()) ++depth;
qDebug() << QByteArray(4 * depth, ' ').constData()
<< (w.parent()? w.parent()->children().indexOf(&w) : -1)
<< w.name() << "childCount:" << w.childCount();
};
root.walkInOrder(Widget::Forward, [&debugPrint] (Widget &w)
{
debugPrint(w);
return LoopContinue;
});
qDebug() << "AND BACKWARDS:";
root.children().last()->walkInOrder(Widget::Backward, [&debugPrint] (Widget &w)
{
debugPrint(w);
return LoopContinue;
});
#endif
*/
}

void appStartupCompleted()
Expand Down

0 comments on commit af0c74c

Please sign in to comment.