diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2020-01-27 14:22:19 +0100 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2020-01-28 10:21:12 +0100 |
commit | 84bc219fb1e9f586c1f7ac2c10172c4da2605f96 (patch) | |
tree | 99d22acb9c4924fa6cd7e3bad23aed4273321445 /src/svg/qsvgrenderer.h | |
parent | 69175cddec56c681b7873d6145cc29e461f1d8b1 (diff) | |
download | qtsvg-84bc219fb1e9f586c1f7ac2c10172c4da2605f96.tar.gz |
Add API to enable opt-in aspect ratio feature in QSvgRenderer
[ChangeLog][QSvgRenderer] Introduced aspect ratio mode property, so
that rendering may be set to preserve the view box aspect ratio.
Task-number: QTBUG-81259
Change-Id: I9802788cdaf2c30974c1ffc34ad5b67cdc74ed57
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/svg/qsvgrenderer.h')
-rw-r--r-- | src/svg/qsvgrenderer.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/svg/qsvgrenderer.h b/src/svg/qsvgrenderer.h index c7da2fb..3703b1c 100644 --- a/src/svg/qsvgrenderer.h +++ b/src/svg/qsvgrenderer.h @@ -65,6 +65,7 @@ class Q_SVG_EXPORT QSvgRenderer : public QObject Q_PROPERTY(QRectF viewBox READ viewBoxF WRITE setViewBox) Q_PROPERTY(int framesPerSecond READ framesPerSecond WRITE setFramesPerSecond) Q_PROPERTY(int currentFrame READ currentFrame WRITE setCurrentFrame) + Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode WRITE setAspectRatioMode) public: QSvgRenderer(QObject *parent = nullptr); QSvgRenderer(const QString &filename, QObject *parent = nullptr); @@ -81,6 +82,9 @@ public: void setViewBox(const QRect &viewbox); void setViewBox(const QRectF &viewbox); + Qt::AspectRatioMode aspectRatioMode() const; + void setAspectRatioMode(Qt::AspectRatioMode mode); + bool animated() const; int framesPerSecond() const; void setFramesPerSecond(int num); |