aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/customization/tst_customization.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-12-19 14:47:09 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2017-12-20 17:37:20 +0000
commitb94cb52c8b03511a2549469dfed33c6e0e857021 (patch)
treeca5b55762740c79f63f17f4d1204202a0dc4babb /tests/auto/customization/tst_customization.cpp
parent4367be99cc89c733b8667a30c8a82dac21ba08bb (diff)
Default: cleanup and test internal IDs
Remove the undesired internal IDs where easily possible, and add expected failures for the harder ones for now. Task-number: QTBUG-65341 Change-Id: I5964b2cb59652661c90141259c68b95c721cf6ca Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/customization/tst_customization.cpp')
-rw-r--r--tests/auto/customization/tst_customization.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/customization/tst_customization.cpp b/tests/auto/customization/tst_customization.cpp
index 10525e9e..e975e546 100644
--- a/tests/auto/customization/tst_customization.cpp
+++ b/tests/auto/customization/tst_customization.cpp
@@ -131,6 +131,7 @@ typedef QHash<QObject *, QString> QObjectNameHash;
Q_GLOBAL_STATIC(QObjectNameHash, qt_objectNames)
Q_GLOBAL_STATIC(QStringList, qt_createdQObjects)
Q_GLOBAL_STATIC(QStringList, qt_destroyedQObjects)
+Q_GLOBAL_STATIC(QStringList, qt_destroyedParentQObjects)
extern "C" Q_DECL_EXPORT void qt_addQObject(QObject *object)
{
@@ -152,6 +153,13 @@ extern "C" Q_DECL_EXPORT void qt_removeQObject(QObject *object)
if (!objectName.isEmpty())
qt_destroyedQObjects()->append(objectName);
qt_objectNames()->remove(object);
+
+ QObject *parent = object->parent();
+ if (parent) {
+ QString parentName = parent->objectName();
+ if (!parentName.isEmpty())
+ qt_destroyedParentQObjects()->append(parentName);
+ }
}
void tst_customization::init()
@@ -179,6 +187,7 @@ void tst_customization::reset()
{
qt_createdQObjects()->clear();
qt_destroyedQObjects()->clear();
+ qt_destroyedParentQObjects()->clear();
}
QObject* tst_customization::createControl(const QString &name, QString *error)
@@ -247,6 +256,11 @@ void tst_customization::creation()
QVERIFY2(qt_createdQObjects()->isEmpty(), qPrintable("unexpectedly created: " + qt_createdQObjects->join(", ")));
QVERIFY2(qt_destroyedQObjects()->isEmpty(), qPrintable("unexpectedly destroyed: " + qt_destroyedQObjects->join(", ") + " were unexpectedly destroyed"));
+
+ QEXPECT_FAIL("Default:BusyIndicator", "TODO: remove internal IDs", Abort);
+ QEXPECT_FAIL("Default:DelayButton", "TODO: remove internal IDs", Abort);
+
+ QVERIFY2(qt_destroyedParentQObjects()->isEmpty(), qPrintable("delegates/children of: " + qt_destroyedParentQObjects->join(", ") + " were unexpectedly destroyed"));
}
void tst_customization::comboPopup()