From d493f676a38f000dd9c22dee6eea2b5ae4291e0a Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sat, 9 Feb 2019 14:52:26 +0100 Subject: QToolBarLayout: replace deprecated calls to QLayout::margin() Replace QLayout::margin() with QLayout::contentsMargins() and add two new helper functions to get the correct margins. Change-Id: I3ad24747e7c6323eaf4386c00c47029009d64f8c Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qmenu_p.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/widgets/widgets/qmenu_p.h') diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h index 3e1aa2f738..12521e7a36 100644 --- a/src/widgets/widgets/qmenu_p.h +++ b/src/widgets/widgets/qmenu_p.h @@ -95,6 +95,12 @@ static inline int &rperp(Qt::Orientation o, QPoint &pos) static inline int &rperp(Qt::Orientation o, QSize &size) { return o == Qt::Vertical ? size.rwidth() : size.rheight(); } +static inline int pick(Qt::Orientation o, const QMargins &m) +{ return o == Qt::Horizontal ? (m.left() + m.right()) : (m.top() + m.bottom()); } + +static inline int perp(Qt::Orientation o, const QMargins &m) +{ return o == Qt::Vertical ? (m.left() + m.right()) : (m.top() + m.bottom()); } + class QTornOffMenu; class QEventLoop; -- cgit v1.2.3