summaryrefslogtreecommitdiffstats
path: root/examples/quick
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-02-24 10:14:57 +0100
committerLiang Qi <liang.qi@qt.io>2017-02-24 11:48:14 +0100
commitb1fa22c1683d9f6cedb001f5ef8a0dac71868935 (patch)
treec30a114c75be071310df974283b928329f9d5c12 /examples/quick
parentba68c325688acf3072715757480497524f61c425 (diff)
parentfe5d69669197a51662061b014810f0242eec5ca7 (diff)
Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts: src/qml/compiler/qv4ssa.cpp src/quick/accessible/qaccessiblequickview_p.h src/quick/items/qquickmousearea.cpp src/quick/util/qquickanimatorjob.cpp tools/qmlplugindump/main.cpp Change-Id: I84474cf39895b9b757403971d2e9196e8c9d1809
Diffstat (limited to 'examples/quick')
-rw-r--r--examples/quick/imageresponseprovider/imageresponseprovider.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/quick/imageresponseprovider/imageresponseprovider.cpp b/examples/quick/imageresponseprovider/imageresponseprovider.cpp
index a888c823a6..d4633b779a 100644
--- a/examples/quick/imageresponseprovider/imageresponseprovider.cpp
+++ b/examples/quick/imageresponseprovider/imageresponseprovider.cpp
@@ -51,37 +51,37 @@ class AsyncImageResponse : public QQuickImageResponse, public QRunnable
{
public:
AsyncImageResponse(const QString &id, const QSize &requestedSize)
- : m_id(id), m_requestedSize(requestedSize), m_texture(0)
+ : m_id(id), m_requestedSize(requestedSize)
{
setAutoDelete(false);
}
QQuickTextureFactory *textureFactory() const
{
- return m_texture;
+ return QQuickTextureFactory::textureFactoryForImage(m_image);
}
void run()
{
- QImage image(50, 50, QImage::Format_RGB32);
+ m_image = QImage(50, 50, QImage::Format_RGB32);
if (m_id == "slow") {
qDebug() << "Slow, red, sleeping for 5 seconds";
QThread::sleep(5);
- image.fill(Qt::red);
+ m_image.fill(Qt::red);
} else {
qDebug() << "Fast, blue, sleeping for 1 second";
QThread::sleep(1);
- image.fill(Qt::blue);
+ m_image.fill(Qt::blue);
}
if (m_requestedSize.isValid())
- image = image.scaled(m_requestedSize);
- m_texture = QQuickTextureFactory::textureFactoryForImage(image);
+ m_image = m_image.scaled(m_requestedSize);
+
emit finished();
}
QString m_id;
QSize m_requestedSize;
- QQuickTextureFactory *m_texture;
+ QImage m_image;
};
class AsyncImageProvider : public QQuickAsyncImageProvider