diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-07-05 04:20:14 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-07-05 08:31:07 (GMT) |
commit | 09f07b98dfdaec2e48749768b967a48e588d3f7f (patch) | |
tree | afb3d254883bef441614a2c9453be8ac9bf51e5f /src/declarative/graphicsitems/qdeclarativetext_p_p.h | |
parent | b2aedd1d57a5a681b1185bf8908683ff563de4d6 (diff) | |
download | Qt-09f07b98dfdaec2e48749768b967a48e588d3f7f.zip Qt-09f07b98dfdaec2e48749768b967a48e588d3f7f.tar.gz Qt-09f07b98dfdaec2e48749768b967a48e588d3f7f.tar.bz2 |
Make declarative pixmap cache easier to use
The QDeclarativePixmapCache was both slow, and very trickey to use correctly.
Many QML elements did not correctly cancel outstanding requests, which leads
to pixmaps leaking indefinately. Other elements, such as Text, were
subject to race conditions that meant they may never actually load all their
images.
QDeclarativePixmap is a single class than encapsulates the action of
fetching a pixmap, as well as the pixmap itself and the responsibility of
canceling outstanding requests. Rather than relying on Qt's pixmap cache
that doesn't cache all the information QML needs, QDeclarativePixmap
implements its own cache, that correctly degrades over time (unlike
QPixmapCache that can stop expiring items in some conditions).
Reviewed-by: Warwick Allison
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativetext_p_p.h')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetext_p_p.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetext_p_p.h b/src/declarative/graphicsitems/qdeclarativetext_p_p.h index 332f99e..51a5514 100644 --- a/src/declarative/graphicsitems/qdeclarativetext_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativetext_p_p.h @@ -124,6 +124,10 @@ public: QSize cachedLayoutSize; QDeclarativeText::TextFormat format; QDeclarativeText::WrapMode wrapMode; + + static inline QDeclarativeTextPrivate *get(QDeclarativeText *t) { + return t->d_func(); + } }; QT_END_NAMESPACE |