diff options
author | Ulf Hermann <ulf.hermann@digia.com> | 2013-12-06 11:47:08 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@digia.com> | 2013-12-09 14:02:43 +0100 |
commit | 7ef028a4fbca26ff5a36909af55f4d3cd728d681 (patch) | |
tree | 40ec5cfc1beb6ec1d71070b8791f775033cd5865 /src/plugins | |
parent | 29d68366083cd1721176dd1bdb031fe7cbea26de (diff) | |
download | qt-creator-7ef028a4fbca26ff5a36909af55f4d3cd728d681.tar.gz |
WelcomePage: Report sizes of loaded images
It's so much nicer for the qml profiler to know the actual sizes of
images ...
Change-Id: Ib1c0d38b002a061e7cffe2619034e144e4d5f2cf
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/qtsupport/gettingstartedwelcomepage.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp index a8e887f473..ce7e361a0f 100644 --- a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp +++ b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp @@ -181,16 +181,19 @@ public: // gets called by declarative in separate thread QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize) { - Q_UNUSED(size) QMutexLocker lock(&m_mutex); QUrl url = QUrl::fromEncoded(id.toLatin1()); - if (!m_fetcher.asynchronousFetchData(url)) - return QImage(); - if (m_fetcher.data().isEmpty()) + if (!m_fetcher.asynchronousFetchData(url) || m_fetcher.data().isEmpty()) { + if (size) { + size->setWidth(0); + size->setHeight(0); + } return QImage(); + } + QByteArray data = m_fetcher.data(); QBuffer imgBuffer(&data); imgBuffer.open(QIODevice::ReadOnly); @@ -198,7 +201,11 @@ public: QImage img = reader.read(); m_fetcher.clearData(); - return ScreenshotCropper::croppedImage(img, id, requestedSize); + img = ScreenshotCropper::croppedImage(img, id, requestedSize); + if (size) + *size = img.size(); + return img; + } private: Fetcher m_fetcher; |