From 84bc219fb1e9f586c1f7ac2c10172c4da2605f96 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Mon, 27 Jan 2020 14:22:19 +0100 Subject: 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 --- src/svg/qsvgrenderer.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/svg/qsvgrenderer.h') 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); -- cgit v1.2.1