diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2015-12-03 17:48:38 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-08-24 12:26:20 +0200 |
commit | 5d995ae122aa07486ead849560b74d2b62b883bb (patch) | |
tree | fba57d7eac473f9a41923bfc7719a5a87a281f79 /src/quick/items/qquickimagebase_p.h | |
parent | 506b4093b47f8ecf29c2e1e83e73e47e9ac767ad (diff) |
Move currentFrame and frameCount properties up to QQuickImageBase
AnimatedImage already had these properties, but some typically non-animated
image formats such as PDF, TIFF and ICO can also support multiple pages.
In either case, the currentFrame property can be used to select a specific
frame or page. However an AnimatedImage uses a QMovie to do that, whereas
a plain Image uses QQuickPixmap. So the accessors need to be virtual in
order to have these different implementations.
[ChangeLog][QtQuick][Image] Image and BorderImage now have currentFrame
and frameCount properties which can be used to step through the frames of
multi-page image formats such as TIFF, WEBP and ICO.
Task-number: QTBUG-77506
Change-Id: Id4d95a99a26a862957e44b1bd8ffe06d7eababef
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/quick/items/qquickimagebase_p.h')
-rw-r--r-- | src/quick/items/qquickimagebase_p.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/quick/items/qquickimagebase_p.h b/src/quick/items/qquickimagebase_p.h index d8d0be9b8c..8cd59c8cea 100644 --- a/src/quick/items/qquickimagebase_p.h +++ b/src/quick/items/qquickimagebase_p.h @@ -68,6 +68,8 @@ class Q_QUICK_PRIVATE_EXPORT QQuickImageBase : public QQuickImplicitSizeItem Q_PROPERTY(bool cache READ cache WRITE setCache NOTIFY cacheChanged) Q_PROPERTY(QSize sourceSize READ sourceSize WRITE setSourceSize RESET resetSourceSize NOTIFY sourceSizeChanged) Q_PROPERTY(bool mirror READ mirror WRITE setMirror NOTIFY mirrorChanged) + Q_PROPERTY(int currentFrame READ currentFrame WRITE setCurrentFrame NOTIFY currentFrameChanged REVISION 14) + Q_PROPERTY(int frameCount READ frameCount NOTIFY frameCountChanged REVISION 14) public: QQuickImageBase(QQuickItem *parent=nullptr); @@ -95,6 +97,11 @@ public: virtual void setMirror(bool mirror); bool mirror() const; + virtual void setCurrentFrame(int frame); + virtual int currentFrame() const; + + virtual int frameCount() const; + virtual void setAutoTransform(bool transform); bool autoTransform() const; @@ -112,6 +119,8 @@ Q_SIGNALS: void asynchronousChanged(); void cacheChanged(); void mirrorChanged(); + Q_REVISION(14) void currentFrameChanged(); + Q_REVISION(14) void frameCountChanged(); protected: virtual void load(); |