diff options
author | Stephan Binner <stephan.binner@basyskom.com> | 2017-09-03 18:45:41 +0200 |
---|---|---|
committer | Stephan Binner <stephan.binner@basyskom.com> | 2017-09-19 10:57:12 +0000 |
commit | 6d699d08200b1fe3a616dfbc275d46c98b77fcbd (patch) | |
tree | 6af5893454cca281d74cfba01109aa0c11135f04 /src/widgets/widgets/qpushbutton.cpp | |
parent | 9833e682174c968efb62e6cd473787e3b0b8fb05 (diff) |
Convert features.menu to QT_[REQUIRE_]CONFIG
Change-Id: I031356411294b259ebd2b22c53159c93fd92af6e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/widgets/widgets/qpushbutton.cpp')
-rw-r--r-- | src/widgets/widgets/qpushbutton.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp index 293d107740..90b1e7ef29 100644 --- a/src/widgets/widgets/qpushbutton.cpp +++ b/src/widgets/widgets/qpushbutton.cpp @@ -46,7 +46,6 @@ #include "qdrawutil.h" #include "qevent.h" #include "qfontmetrics.h" -#include "qmenu.h" #include "qstylepainter.h" #include "qpixmap.h" #include "qpointer.h" @@ -68,7 +67,10 @@ #include "qaccessible.h" #endif +#if QT_CONFIG(menu) +#include "qmenu.h" #include "private/qmenu_p.h" +#endif #include "private/qpushbutton_p.h" QT_BEGIN_NAMESPACE @@ -317,7 +319,7 @@ void QPushButton::initStyleOption(QStyleOptionButton *option) const option->features = QStyleOptionButton::None; if (d->flat) option->features |= QStyleOptionButton::Flat; -#ifndef QT_NO_MENU +#if QT_CONFIG(menu) if (d->menu) option->features |= QStyleOptionButton::HasMenu; #endif @@ -422,7 +424,7 @@ QSize QPushButton::sizeHint() const if(!empty || !h) h = qMax(h, sz.height()); opt.rect.setSize(QSize(w, h)); // PM_MenuButtonIndicator depends on the height -#ifndef QT_NO_MENU +#if QT_CONFIG(menu) if (menu()) w += style()->pixelMetric(QStyle::PM_MenuButtonIndicator, &opt, this); #endif @@ -502,13 +504,13 @@ void QPushButton::focusOutEvent(QFocusEvent *e) } QAbstractButton::focusOutEvent(e); -#ifndef QT_NO_MENU +#if QT_CONFIG(menu) if (d->menu && d->menu->isVisible()) // restore pressed status setDown(true); #endif } -#ifndef QT_NO_MENU +#if QT_CONFIG(menu) /*! Associates the popup menu \a menu with this push button. This turns the button into a menu button, which in some styles will @@ -631,7 +633,7 @@ QPoint QPushButtonPrivate::adjustedMenuPosition() return QPoint(x,y); } -#endif // QT_NO_MENU +#endif // QT_CONFIG(menu) void QPushButtonPrivate::resetLayoutItemMargins() { |