diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-02-09 14:52:26 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-02-13 05:55:40 +0000 |
commit | d493f676a38f000dd9c22dee6eea2b5ae4291e0a (patch) | |
tree | 869d84c01876148812585827b64ae90ec97280d9 /src/widgets/widgets/qmenu_p.h | |
parent | 3c907d0f4a0bbd4f2d4116d9bb0929c51f7cc905 (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.h | 6 |
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; |