diff options
Diffstat (limited to 'src/corelib/tools/qrect.h')
-rw-r--r-- | src/corelib/tools/qrect.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/tools/qrect.h b/src/corelib/tools/qrect.h index 52f1a79362..5f59bde269 100644 --- a/src/corelib/tools/qrect.h +++ b/src/corelib/tools/qrect.h @@ -463,6 +463,12 @@ Q_DECL_CONSTEXPR inline QRect operator+(const QMargins &margins, const QRect &re QPoint(rectangle.right() + margins.right(), rectangle.bottom() + margins.bottom())); } +Q_DECL_CONSTEXPR inline QRect operator-(const QRect &lhs, const QMargins &rhs) +{ + return QRect(QPoint(lhs.left() + rhs.left(), lhs.top() + rhs.top()), + QPoint(lhs.right() - rhs.right(), lhs.bottom() - rhs.bottom())); +} + Q_DECL_CONSTEXPR inline QRect QRect::marginsAdded(const QMargins &margins) const { return QRect(QPoint(x1 - margins.left(), y1 - margins.top()), |