summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp')
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index ea0d5e8871..040ad17c74 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -335,6 +335,8 @@ private slots:
void resizeInPaintEvent();
void opaqueChildren();
+ void dumpObjectTree();
+
void setMaskInResizeEvent();
void moveInResizeEvent();
@@ -9060,6 +9062,44 @@ void tst_QWidget::opaqueChildren()
QCOMPARE(qt_widget_private(&grandChild)->getOpaqueChildren(), QRegion());
}
+void tst_QWidget::dumpObjectTree()
+{
+ QWidget w;
+ w.setWindowTitle(QLatin1String(QTest::currentTestFunction()));
+ Q_SET_OBJECT_NAME(w);
+ w.move(100, 100);
+ w.resize(500, 500);
+
+ QLineEdit le(&w);
+ Q_SET_OBJECT_NAME(le);
+ le.resize(500, 500);
+
+ {
+ const char * const expected[] = {
+ "QWidget::w I",
+ " QLineEdit::le I",
+ " QWidgetLineControl:: ",
+ };
+ for (const char *line : expected)
+ QTest::ignoreMessage(QtDebugMsg, line);
+ w.dumpObjectTree();
+ }
+
+ w.show();
+ QApplication::setActiveWindow(&w);
+ QVERIFY(QTest::qWaitForWindowActive(&w));
+
+ {
+ const char * const expected[] = {
+ "QWidget::w <500x500+100+100>",
+ " QLineEdit::le F<500x500+0+0>",
+ " QWidgetLineControl:: ",
+ };
+ for (const char *line : expected)
+ QTest::ignoreMessage(QtDebugMsg, line);
+ w.dumpObjectTree();
+ }
+}
class MaskSetWidget : public QWidget
{