summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp13
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext_p.h4
2 files changed, 5 insertions, 12 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index 9fcfd92..a95c930 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -77,7 +77,7 @@ protected:
if (type == QTextDocument::ImageResource) {
QPixmap pm;
QString errorString;
- QDeclarativePixmapReply::Status status = QDeclarativePixmapCache::get(url, &pm, &errorString, 0, true, 0, 0);
+ QDeclarativePixmapReply::Status status = QDeclarativePixmapCache::get(url, &pm, &errorString, 0, false, 0, 0);
if (status == QDeclarativePixmapReply::Ready)
return pm;
if (status == QDeclarativePixmapReply::Error) {
@@ -89,7 +89,6 @@ protected:
QDeclarativePixmapReply *reply = QDeclarativePixmapCache::request(qmlEngine(parent()), url);
connect(reply, SIGNAL(finished()), this, SLOT(requestFinished()));
outstanding++;
- static_cast<QDeclarativeText*>(parent())->reloadWithResources();
}
}
@@ -100,7 +99,8 @@ private slots:
void requestFinished()
{
outstanding--;
- static_cast<QDeclarativeText*>(parent())->reloadWithResources();
+ if (outstanding == 0)
+ static_cast<QDeclarativeText*>(parent())->reloadWithResources();
}
private:
@@ -968,17 +968,13 @@ void QDeclarativeText::reloadWithResources()
Q_D(QDeclarativeText);
if (!d->richText)
return;
- if (resourcesLoading()!=0)
- return;
- emit resourcesLoadingChanged();
d->doc->setHtml(d->text);
d->updateLayout();
d->markImgDirty();
}
/*!
- \qmlproperty int Text::resourcesLoading
- This property is the number of resources (images) that are being loaded asynchronously.
+ Returns the number of resources (images) that are being loaded asynchronously.
*/
int QDeclarativeText::resourcesLoading() const
{
@@ -986,7 +982,6 @@ int QDeclarativeText::resourcesLoading() const
return d->doc ? d->doc->resourcesLoading() : 0;
}
-
void QDeclarativeText::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
{
Q_D(QDeclarativeText);
diff --git a/src/declarative/graphicsitems/qdeclarativetext_p.h b/src/declarative/graphicsitems/qdeclarativetext_p.h
index fcad898..4fd5e3a 100644
--- a/src/declarative/graphicsitems/qdeclarativetext_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetext_p.h
@@ -72,7 +72,6 @@ class Q_DECLARATIVE_EXPORT QDeclarativeText : public QDeclarativeItem
Q_PROPERTY(bool wrap READ wrap WRITE setWrap NOTIFY wrapModeChanged)
Q_PROPERTY(TextFormat textFormat READ textFormat WRITE setTextFormat NOTIFY textFormatChanged)
Q_PROPERTY(TextElideMode elide READ elideMode WRITE setElideMode NOTIFY elideModeChanged) //### elideMode?
- Q_PROPERTY(int resourcesLoading READ resourcesLoading NOTIFY resourcesLoadingChanged)
public:
QDeclarativeText(QDeclarativeItem *parent=0);
@@ -139,7 +138,7 @@ public:
virtual void componentComplete();
- int resourcesLoading() const;
+ int resourcesLoading() const; // mainly for testing
Q_SIGNALS:
void textChanged(const QString &text);
@@ -153,7 +152,6 @@ Q_SIGNALS:
void wrapModeChanged();
void textFormatChanged(TextFormat textFormat);
void elideModeChanged(TextElideMode mode);
- void resourcesLoadingChanged();
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event);