diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2019-05-24 21:41:17 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-05-27 15:51:55 +0200 |
commit | ca0c9f82cbf7c8c37acdcbdfdc3fa0c5fc138059 (patch) | |
tree | 091da154ca185af5a49296ef69a8701974c238cc /src/widgets/graphicsview/qgraphicswidget.h | |
parent | 0eb26c144346dcb12008e5b3e9441073f09668a8 (diff) |
QGraphicsWidget: overload two margins-setters with actual QMarginsF overloads
Replace manual memory management with unique_ptr and manual
re-implementations of QMarginsF with The Real Thing™.
The only noticeable difference should be that the checks for 0 now use
qFuzzyCompare() (by way of QMarginsF::isNull() and its operator==).
[ChangeLog][QtWidgets][QGraphicsWidget] Added QMarginsF overloads of
setContentsMargins() and setWindowFrameMargins().
Change-Id: I6b3bb87015fa52fdde245b7528cca4b8f9ce41e1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/graphicsview/qgraphicswidget.h')
-rw-r--r-- | src/widgets/graphicsview/qgraphicswidget.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/graphicsview/qgraphicswidget.h b/src/widgets/graphicsview/qgraphicswidget.h index 481fb55db3..8223b921c9 100644 --- a/src/widgets/graphicsview/qgraphicswidget.h +++ b/src/widgets/graphicsview/qgraphicswidget.h @@ -111,9 +111,11 @@ public: inline QRectF rect() const { return QRectF(QPointF(), size()); } void setContentsMargins(qreal left, qreal top, qreal right, qreal bottom); + void setContentsMargins(QMarginsF margins); void getContentsMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const override; void setWindowFrameMargins(qreal left, qreal top, qreal right, qreal bottom); + void setWindowFrameMargins(QMarginsF margins); void getWindowFrameMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const; void unsetWindowFrameMargins(); QRectF windowFrameGeometry() const; |