diff options
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativetext.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetext.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index 3b39fa4..9fcfd92 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -45,6 +45,7 @@ #include <qdeclarativeinfo.h> #include <qdeclarativepixmapcache_p.h> +#include <QSet> #include <QTextLayout> #include <QTextLine> #include <QTextDocument> @@ -75,10 +76,16 @@ protected: if (type == QTextDocument::ImageResource) { QPixmap pm; - QDeclarativePixmapReply::Status status = QDeclarativePixmapCache::get(url, &pm, 0, true, 0, 0); + QString errorString; + QDeclarativePixmapReply::Status status = QDeclarativePixmapCache::get(url, &pm, &errorString, 0, true, 0, 0); if (status == QDeclarativePixmapReply::Ready) return pm; - if (status != QDeclarativePixmapReply::Error) { + if (status == QDeclarativePixmapReply::Error) { + if (!errors.contains(url)) { + errors.insert(url); + qmlInfo(parent()) << errorString; + } + } else { QDeclarativePixmapReply *reply = QDeclarativePixmapCache::request(qmlEngine(parent()), url); connect(reply, SIGNAL(finished()), this, SLOT(requestFinished())); outstanding++; @@ -98,8 +105,11 @@ private slots: private: int outstanding; + static QSet<QUrl> errors; }; +QSet<QUrl> QTextDocumentWithImageResources::errors; + /*! \qmlclass Text QDeclarativeText \since 4.7 |