diff options
author | Stephan Binner <stephan.binner@basyskom.com> | 2017-08-27 19:07:31 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2018-05-02 09:07:03 +0000 |
commit | 364bd6ca74b059ffe8ae367e1562645a3ed0855e (patch) | |
tree | de86fa29ad2835030603e39c5fac2b0f186ad8c9 /src/widgets/widgets/qmenu_p.h | |
parent | 3761d99512244ae167a66e6894c75eb2ef1cca48 (diff) |
Convert features.toolbar to QT_[REQUIRE_]CONFIG
Move declaration of pick/perp helpers up the dependency chain
Change-Id: I7084ed829a057a0c45d60445c416fb07f2cb5624
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/widgets/widgets/qmenu_p.h')
-rw-r--r-- | src/widgets/widgets/qmenu_p.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h index b6afb05e3a..721a35bf90 100644 --- a/src/widgets/widgets/qmenu_p.h +++ b/src/widgets/widgets/qmenu_p.h @@ -68,6 +68,33 @@ QT_REQUIRE_CONFIG(menu); QT_BEGIN_NAMESPACE +static inline int pick(Qt::Orientation o, const QPoint &pos) +{ return o == Qt::Horizontal ? pos.x() : pos.y(); } + +static inline int pick(Qt::Orientation o, const QSize &size) +{ return o == Qt::Horizontal ? size.width() : size.height(); } + +static inline int &rpick(Qt::Orientation o, QPoint &pos) +{ return o == Qt::Horizontal ? pos.rx() : pos.ry(); } + +static inline int &rpick(Qt::Orientation o, QSize &size) +{ return o == Qt::Horizontal ? size.rwidth() : size.rheight(); } + +static inline QSizePolicy::Policy pick(Qt::Orientation o, const QSizePolicy &policy) +{ return o == Qt::Horizontal ? policy.horizontalPolicy() : policy.verticalPolicy(); } + +static inline int perp(Qt::Orientation o, const QPoint &pos) +{ return o == Qt::Vertical ? pos.x() : pos.y(); } + +static inline int perp(Qt::Orientation o, const QSize &size) +{ return o == Qt::Vertical ? size.width() : size.height(); } + +static inline int &rperp(Qt::Orientation o, QPoint &pos) +{ return o == Qt::Vertical ? pos.rx() : pos.ry(); } + +static inline int &rperp(Qt::Orientation o, QSize &size) +{ return o == Qt::Vertical ? size.rwidth() : size.rheight(); } + class QTornOffMenu; class QEventLoop; |