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.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index d977f78b23..8dacab7c3b 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -69,6 +69,7 @@
#include <QtWidgets/QGraphicsView>
#include <QtWidgets/QGraphicsProxyWidget>
#include <QtGui/qwindow.h>
+#include <qtimer.h>
#include "../../../qtest-config.h"
@@ -76,7 +77,7 @@
#include "tst_qwidget_mac_helpers.h" // Abstract the ObjC stuff out so not everyone must run an ObjC++ compile.
#endif
-#include <QtTest/QtTest>
+#include <QtTest/QTest>
#ifdef Q_OS_WIN
# include <QtCore/qt_windows.h>
@@ -446,6 +447,8 @@ private slots:
void resizeStaticContentsChildWidget_QTBUG35282();
+ void qmlSetParentHelper();
+
private:
bool ensureScreenSize(int width, int height);
QWidget *testWidget;
@@ -10418,5 +10421,20 @@ void tst_QWidget::resizeStaticContentsChildWidget_QTBUG35282()
msgComparisonFailed(childWidget.numPaintEvents, ">=", 1));
}
+void tst_QWidget::qmlSetParentHelper()
+{
+#ifdef QT_BUILD_INTERNAL
+ QWidget parent;
+ QWidget child;
+ QVERIFY(QAbstractDeclarativeData::setWidgetParent);
+ QAbstractDeclarativeData::setWidgetParent(&child, &parent);
+ QVERIFY(child.parentWidget() == &parent);
+ QAbstractDeclarativeData::setWidgetParent(&child, 0);
+ QVERIFY(!child.parentWidget());
+#else
+ QSKIP("Needs QT_BUILD_INTERNAL");
+#endif
+}
+
QTEST_MAIN(tst_QWidget)
#include "tst_qwidget.moc"