From: Taylor Braun-Jones Date: Thu, 31 Jul 2014 23:47:04 +0000 (-0400) Subject: Don't try to reload QQuick images when changing to null screen X-Git-Tag: v5.3.99+beta1~80^2^2~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8076b428d2e6b8de8bacf556b8dccb5bbd99e0ac;p=platform%2Fupstream%2Fqtdeclarative.git Don't try to reload QQuick images when changing to null screen When a QGuiApplication is destructing, a screen change occurs causing QQuickImageBase to reload images ultimately resulting in "QPixmap: Must construct a QGuiApplication before a QPixmap". This patch fixes the issue (except for systems which multiple screens, which is a separate issue). Task-number: QTBUG-40539 Change-Id: I4bafc9790741204e90190a4491ac7a9393d0d0a7 Reviewed-by: J-P Nurmi Reviewed-by: Gunnar Sletta --- diff --git a/src/quick/items/qquickimagebase.cpp b/src/quick/items/qquickimagebase.cpp index bf67cbe..738430d 100644 --- a/src/quick/items/qquickimagebase.cpp +++ b/src/quick/items/qquickimagebase.cpp @@ -292,10 +292,10 @@ void QQuickImageBase::handleWindowChanged(QQuickWindow* window) connect(window, SIGNAL(screenChanged(QScreen*)), this, SLOT(handleScreenChanged(QScreen*))); } -void QQuickImageBase::handleScreenChanged(QScreen*) +void QQuickImageBase::handleScreenChanged(QScreen* screen) { // Screen DPI might have changed, reload images on screen change. - if (isComponentComplete()) + if (screen && isComponentComplete()) load(); } diff --git a/src/quick/items/qquickimagebase_p.h b/src/quick/items/qquickimagebase_p.h index 67f1e81..a3d9e3a 100644 --- a/src/quick/items/qquickimagebase_p.h +++ b/src/quick/items/qquickimagebase_p.h @@ -107,7 +107,7 @@ private Q_SLOTS: virtual void requestFinished(); void requestProgress(qint64,qint64); void handleWindowChanged(QQuickWindow *window); - void handleScreenChanged(QScreen *); + void handleScreenChanged(QScreen *screen); private: Q_DISABLE_COPY(QQuickImageBase)