aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qmltest/quicktest.cpp22
-rw-r--r--src/quick/scenegraph/qsgrenderloop.cpp7
-rw-r--r--src/quick/scenegraph/qsgwindowsrenderloop.cpp1
-rw-r--r--src/quick/util/qquickpixmapcache.cpp8
-rw-r--r--tests/auto/quick/qquickwindow/BLACKLIST2
5 files changed, 24 insertions, 16 deletions
diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp
index 947039f60e..5e9712d202 100644
--- a/src/qmltest/quicktest.cpp
+++ b/src/qmltest/quicktest.cpp
@@ -350,6 +350,8 @@ int quick_test_main(int argc, char **argv, const char *name, const char *sourceD
if (QTest::printAvailableFunctions)
continue;
+ while (view->status() == QQuickView::Loading)
+ QTest::qWait(10);
if (view->status() == QQuickView::Error) {
handleCompileErrors(fi, view);
continue;
@@ -368,14 +370,22 @@ int quick_test_main(int argc, char **argv, const char *name, const char *sourceD
view->resize(200, 200);
}
view->show();
+ if (!QTest::qWaitForWindowExposed(view)) {
+ qWarning().nospace()
+ << "Test '" << QDir::toNativeSeparators(path) << "' window not exposed after show().";
+ }
view->requestActivate();
-
- while (view->status() == QQuickView::Loading)
- QTest::qWait(10);
-
- QTest::qWaitForWindowActive(view);
- if (view->isExposed())
+ if (!QTest::qWaitForWindowActive(view)) {
+ qWarning().nospace()
+ << "Test '" << QDir::toNativeSeparators(path) << "' window not active after requestActivate().";
+ }
+ if (view->isExposed()) {
QTestRootObject::instance()->setWindowShown(true);
+ } else {
+ qWarning().nospace()
+ << "Test '" << QDir::toNativeSeparators(path) << "' window was never exposed! "
+ << "If the test case was expecting windowShown, it will hang.";
+ }
if (!QTestRootObject::instance()->hasQuit && QTestRootObject::instance()->hasTestCase())
eventLoop.exec();
// view->hide(); Causes a crash in Qt 3D due to deletion of the GL context, see QTBUG-27696
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp
index 61de81576c..ce3bf7d61d 100644
--- a/src/quick/scenegraph/qsgrenderloop.cpp
+++ b/src/quick/scenegraph/qsgrenderloop.cpp
@@ -91,12 +91,8 @@ void QSGRenderLoop::cleanup()
foreach (QQuickWindow *w, s_instance->windows()) {
QQuickWindowPrivate *wd = QQuickWindowPrivate::get(w);
if (wd->windowManager == s_instance) {
- // windowDestroyed() triggers a sendPostedEvent(DeferredDelete),
- // so wd will be null if the window was deleteLater()'ed
- bool wasDeleted = wd->wasDeleted;
s_instance->windowDestroyed(w);
- if (!wasDeleted)
- wd->windowManager = 0;
+ wd->windowManager = 0;
}
}
delete s_instance;
@@ -300,7 +296,6 @@ void QSGGuiThreadRenderLoop::windowDestroyed(QQuickWindow *window)
d->cleanupNodesOnShutdown();
if (m_windows.size() == 0) {
rc->invalidate();
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
delete gl;
gl = 0;
} else if (gl && window == gl->surface() && current) {
diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
index e4db348ef0..b88d21ce66 100644
--- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp
+++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
@@ -234,7 +234,6 @@ void QSGWindowsRenderLoop::windowDestroyed(QQuickWindow *window)
d->cleanupNodesOnShutdown();
if (m_windows.size() == 0) {
d->context->invalidate();
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
delete m_gl;
m_gl = 0;
} else if (m_gl && current) {
diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp
index 2066d1e405..5199808251 100644
--- a/src/quick/util/qquickpixmapcache.cpp
+++ b/src/quick/util/qquickpixmapcache.cpp
@@ -526,10 +526,12 @@ void QQuickPixmapReader::processJobs()
for (int i = 0; i < cancelled.count(); ++i) {
QQuickPixmapReply *job = cancelled.at(i);
QNetworkReply *reply = replies.key(job, 0);
- if (reply && reply->isRunning()) {
- // cancel any jobs already started
+ if (reply) {
replies.remove(reply);
- reply->close();
+ if (reply->isRunning()) {
+ // cancel any jobs already started
+ reply->close();
+ }
}
PIXMAP_PROFILE(pixmapStateChanged<QQuickProfiler::PixmapLoadingError>(job->url));
// deleteLater, since not owned by this thread
diff --git a/tests/auto/quick/qquickwindow/BLACKLIST b/tests/auto/quick/qquickwindow/BLACKLIST
new file mode 100644
index 0000000000..1201ef12f0
--- /dev/null
+++ b/tests/auto/quick/qquickwindow/BLACKLIST
@@ -0,0 +1,2 @@
+[testWindowVisibilityOrder]
+osx