Fix crash when hosting QQuickWidget

There's no need to check if invisible widgets are candidates
for docking. There's usually no downside either, except that
QQuickWidget is very sensitive with when its platform window
is created, so don't force the creation.

Will cherry-pick to 1.2 if no regression is found

Fixes #150
This commit is contained in:
Sergio Martins
2021-01-31 12:59:02 +00:00
parent 02cf9d1cd2
commit a6b9a82e9c
2 changed files with 5 additions and 0 deletions

View File

@@ -648,6 +648,10 @@ static QWidgetOrQuick *qtTopLevelForHWND(HWND hwnd)
{
const QList<QWindow*> windows = qApp->topLevelWindows();
for (QWindow *window : windows) {
if (!window->isVisible()) {
continue;
}
if (hwnd == (HWND)window->winId()) {
return DockRegistry::self()->topLevelForHandle(window);
}