Change-Id: Icec38fb08d6dc31fb6d0d86ec280fbb4557d5b67
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
// to avoid a relayout later on.
QUrl url = baseUrl.resolved(image->url);
if (url.isLocalFile()) {
- QQuickPixmap *pix = new QQuickPixmap(context->engine(), url, image->size);
- if (pix && pix->isReady()) {
- image->size = pix->implicitSize();
- image->pix = pix;
+ image->pix = new QQuickPixmap(context->engine(), url, image->size);
+ if (image->pix && image->pix->isReady()) {
+ image->size = image->pix->implicitSize();
+ } else {
+ delete image->pix;
+ image->pix = 0;
}
}
}