summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qmenu_p.h
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-02-09 14:52:26 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-02-13 05:55:40 +0000
commitd493f676a38f000dd9c22dee6eea2b5ae4291e0a (patch)
tree869d84c01876148812585827b64ae90ec97280d9 /src/widgets/widgets/qmenu_p.h
parent3c907d0f4a0bbd4f2d4116d9bb0929c51f7cc905 (diff)
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 <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/widgets/qmenu_p.h')
-rw-r--r--src/widgets/widgets/qmenu_p.h6
1 files changed, 6 insertions, 0 deletions
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;