summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Trotsenko <alex1973tr@gmail.com>2019-08-21 18:53:41 +0300
committerAlex Trotsenko <alex1973tr@gmail.com>2019-08-22 16:34:40 +0300
commitd55712153a357cc5cc975bf599470619b7c77faa (patch)
tree67f5874626a422f2e657ba7e0c5c5ae5cd477747
parent9b14950ff600a4ce5a8698b67ab38907c50417f1 (diff)
tst_NoQtEventLoop: destroy hidden windows
Otherwise, we get a warning: QWARN : tst_NoQtEventLoop::consumeSocketEvents() QWindowsContext::windowsProc: No Qt Window found for event 0x2a3 (WM_MOUSELEAVE), hwnd=0x0x9b80646. in the event loop which is running by another test. So, add missing 'delete' call. Change-Id: Ib9b24155bdd6e78062a5234c317c9f878906e413 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--tests/auto/gui/kernel/noqteventloop/tst_noqteventloop.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/auto/gui/kernel/noqteventloop/tst_noqteventloop.cpp b/tests/auto/gui/kernel/noqteventloop/tst_noqteventloop.cpp
index 4fca9a07fc..19c5c8a4a0 100644
--- a/tests/auto/gui/kernel/noqteventloop/tst_noqteventloop.cpp
+++ b/tests/auto/gui/kernel/noqteventloop/tst_noqteventloop.cpp
@@ -258,8 +258,8 @@ void tst_NoQtEventLoop::consumeMouseEvents()
::SetWindowPos(mainWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
- Window *childWindow = new Window;
- childWindow->setParent(QWindow::fromWinId((WId)mainWnd));
+ QWindow *mainWindow = QWindow::fromWinId(reinterpret_cast<WId>(mainWnd));
+ Window *childWindow = new Window(mainWindow);
childWindow->setGeometry(margin, topVerticalMargin,
width - 2 * margin, height - margin - topVerticalMargin);
childWindow->show();
@@ -276,6 +276,7 @@ void tst_NoQtEventLoop::consumeMouseEvents()
if (g_exit)
break;
}
+ delete mainWindow;
QCOMPARE(testThread->passed(), true);