tests: Check for the existence of QWindow at exit, not QWidget

So we're clean for QtQuick too
This commit is contained in:
Sergio Martins
2020-11-19 16:34:30 +00:00
parent 921d0892a0
commit 0cf148b389

View File

@@ -95,9 +95,9 @@ struct EnsureTopLevelsDeleted
~EnsureTopLevelsDeleted()
{
if (topLevels().size() != 0) {
qWarning() << "There's still top-level widgets present!" << topLevels();
}
const QWindowList topLevels = qApp->topLevelWindows();
if (!topLevels.isEmpty())
qWarning() << "There's still top-level widgets present!" << topLevels;
// Other cleanup, since we use this class everywhere
Config::self().setDockWidgetFactoryFunc(nullptr);
@@ -105,18 +105,6 @@ struct EnsureTopLevelsDeleted
Config::self().setSeparatorThickness(m_originalSeparatorThickness);
}
QWidgetList topLevels() const
{
QWidgetList result;
#ifdef KDDOCKWIDGETS_QTWIDGETS
for (QWidget *w : qApp->topLevelWidgets()) {
if (!qobject_cast<QToolButton*>(w))
result << w;
}
#endif
return result;
}
const Config::Flags m_originalFlags;
const int m_originalSeparatorThickness;
};
@@ -438,6 +426,7 @@ inline EmbeddedWindow *createEmbeddedMainWindow(QSize sz)
lay->addWidget(mainwindow);
#else
// TODO: For QtQuick we need some QML
qWarning() << "Parent me!";
#endif
window->show();
window->resize(sz);