summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
authorStephan Binner <stephan.binner@basyskom.com>2017-07-29 09:04:28 +0200
committerStephan Binner <stephan.binner@basyskom.com>2017-08-10 05:37:30 +0000
commitee29be91c0b77d12f913f8f0b8d3f0d11a3a40fa (patch)
tree16838c05999760c53f713995b2360a1312b4720b /src/widgets/styles
parente58fdbaeb033a801ac7b5dd1f63657b36d6e1305 (diff)
Convert features.toolbutton to QT_[REQUIRE_]CONFIG
Change-Id: I4227e1868da21bded76a8ec55996c436c8a8d763 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qcommonstyle.cpp26
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm6
-rw-r--r--src/widgets/styles/qmacstyle_mac_p_p.h2
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp4
-rw-r--r--src/widgets/styles/qwindowsvistastyle_p_p.h2
-rw-r--r--src/widgets/styles/qwindowsxpstyle.cpp6
6 files changed, 29 insertions, 17 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index ca4fcc5bd3..64a3a73b0d 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -78,7 +78,9 @@
#include <qtabwidget.h>
#endif
#include <qtoolbar.h>
+#if QT_CONFIG(toolbutton)
#include <qtoolbutton.h>
+#endif
#if QT_CONFIG(rubberband)
#include <qrubberband.h>
#endif
@@ -807,7 +809,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
}
}
-#ifndef QT_NO_TOOLBUTTON
+#if QT_CONFIG(toolbutton)
static void drawArrow(const QStyle *style, const QStyleOptionToolButton *toolbutton,
const QRect &rect, QPainter *painter, const QWidget *widget = 0)
{
@@ -832,7 +834,7 @@ static void drawArrow(const QStyle *style, const QStyleOptionToolButton *toolbut
arrowOpt.rect = rect;
style->drawPrimitive(pe, &arrowOpt, painter, widget);
}
-#endif // QT_NO_TOOLBUTTON
+#endif // QT_CONFIG(toolbutton)
#if QT_CONFIG(itemviews)
@@ -1584,7 +1586,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
(header->state & State_Enabled), header->text, QPalette::ButtonText);
}
break;
-#ifndef QT_NO_TOOLBUTTON
+#if QT_CONFIG(toolbutton)
case CE_ToolButtonLabel:
if (const QStyleOptionToolButton *toolbutton
= qstyleoption_cast<const QStyleOptionToolButton *>(opt)) {
@@ -1668,7 +1670,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
}
}
break;
-#endif // QT_NO_TOOLBUTTON
+#endif // QT_CONFIG(toolbutton)
#if QT_CONFIG(toolbox)
case CE_ToolBoxTab:
if (const QStyleOptionToolBox *tb = qstyleoption_cast<const QStyleOptionToolBox *>(opt)) {
@@ -3353,7 +3355,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
}
break;
#endif // QT_NO_SPINBOX
-#ifndef QT_NO_TOOLBUTTON
+#if QT_CONFIG(toolbutton)
case CC_ToolButton:
if (const QStyleOptionToolButton *toolbutton
= qstyleoption_cast<const QStyleOptionToolButton *>(opt)) {
@@ -3414,7 +3416,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
}
}
break;
-#endif // QT_NO_TOOLBUTTON
+#endif // QT_CONFIG(toolbutton)
case CC_TitleBar:
if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) {
QRect ir;
@@ -3855,7 +3857,7 @@ QStyle::SubControl QCommonStyle::hitTestComplexControl(ComplexControl cc, const
}
break;
#endif // QT_CONFIG(scrollbar)
-#ifndef QT_NO_TOOLBUTTON
+#if QT_CONFIG(toolbutton)
case CC_ToolButton:
if (const QStyleOptionToolButton *toolbutton = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) {
QRect r;
@@ -3870,7 +3872,7 @@ QStyle::SubControl QCommonStyle::hitTestComplexControl(ComplexControl cc, const
}
}
break;
-#endif // QT_NO_TOOLBUTTON
+#endif // QT_CONFIG(toolbutton)
#ifndef QT_NO_SPINBOX
case CC_SpinBox:
if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
@@ -4125,7 +4127,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
}
break;
#endif // Qt_NO_SPINBOX
-#ifndef QT_NO_TOOLBUTTON
+#if QT_CONFIG(toolbutton)
case CC_ToolButton:
if (const QStyleOptionToolButton *tb = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) {
int mbi = proxy()->pixelMetric(PM_MenuButtonIndicator, tb, widget);
@@ -4149,7 +4151,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
ret = visualRect(tb->direction, tb->rect, ret);
}
break;
-#endif // QT_NO_TOOLBUTTON
+#endif // QT_CONFIG(toolbutton)
#if QT_CONFIG(combobox)
case CC_ComboBox:
if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
@@ -4844,11 +4846,11 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
}
break;
#endif // QT_NO_MENU
-#ifndef QT_NO_TOOLBUTTON
+#if QT_CONFIG(toolbutton)
case CT_ToolButton:
sz = QSize(sz.width() + 6, sz.height() + 5);
break;
-#endif // QT_NO_TOOLBUTTON
+#endif // QT_CONFIG(toolbutton)
#if QT_CONFIG(combobox)
case CT_ComboBox:
if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index ed6bde5404..e517ba3d04 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -97,7 +97,9 @@
#include <qsizegrip.h>
#include <qstyleoption.h>
#include <qtoolbar.h>
+#if QT_CONFIG(toolbutton)
#include <qtoolbutton.h>
+#endif
#if QT_CONFIG(treeview)
#include <qtreeview.h>
#endif
@@ -657,7 +659,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
else if (qobject_cast<const QComboBox *>(widg))
ct = QStyle::CT_ComboBox;
#endif
-#ifndef QT_NO_TOOLBUTTON
+#if QT_CONFIG(toolbutton)
else if (qobject_cast<const QToolButton *>(widg))
ct = QStyle::CT_ToolButton;
#endif
@@ -792,7 +794,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
if (sz == QAquaSizeSmall) {
int width = 0, height = 0;
if (szHint == QSize(-1, -1)) { //just 'guess'..
-#ifndef QT_NO_TOOLBUTTON
+#if QT_CONFIG(toolbutton)
const QToolButton *bt = qobject_cast<const QToolButton *>(widg);
// If this conversion fails then the widget was not what it claimed to be.
if(bt) {
diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h
index 409063e531..b9ba1d828e 100644
--- a/src/widgets/styles/qmacstyle_mac_p_p.h
+++ b/src/widgets/styles/qmacstyle_mac_p_p.h
@@ -104,7 +104,9 @@
#include <qtextedit.h>
#include <qtextstream.h>
#include <qtoolbar.h>
+#if QT_CONFIG(toolbutton)
#include <qtoolbutton.h>
+#endif
#if QT_CONFIG(treeview)
#include <qtreeview.h>
#endif
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 740fb4fa47..f704745c8f 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -60,7 +60,9 @@
#include "private/qabstractscrollarea_p.h"
#include <qtooltip.h>
#include <qshareddata.h>
+#if QT_CONFIG(toolbutton)
#include <qtoolbutton.h>
+#endif
#if QT_CONFIG(scrollbar)
#include <qscrollbar.h>
#endif
@@ -4638,7 +4640,7 @@ int QStyleSheetStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const
switch (m) {
case PM_MenuButtonIndicator:
-#ifndef QT_NO_TOOLBUTTON
+#if QT_CONFIG(toolbutton)
// QToolButton adds this directly to the width
if (qobject_cast<const QToolButton *>(w) && (rule.hasBox() || !rule.hasNativeBorder()))
return 0;
diff --git a/src/widgets/styles/qwindowsvistastyle_p_p.h b/src/widgets/styles/qwindowsvistastyle_p_p.h
index 4973c20440..fdc3297ea6 100644
--- a/src/widgets/styles/qwindowsvistastyle_p_p.h
+++ b/src/widgets/styles/qwindowsvistastyle_p_p.h
@@ -69,7 +69,9 @@
#include <qradiobutton.h>
#include <qlineedit.h>
#include <qgroupbox.h>
+#if QT_CONFIG(toolbutton)
#include <qtoolbutton.h>
+#endif
#include <qspinbox.h>
#include <qtoolbar.h>
#if QT_CONFIG(combobox)
diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp
index b74c4123b3..5d7699321e 100644
--- a/src/widgets/styles/qwindowsxpstyle.cpp
+++ b/src/widgets/styles/qwindowsxpstyle.cpp
@@ -57,7 +57,9 @@
#include <qpa/qplatformnativeinterface.h>
#include <qdesktopwidget.h>
+#if QT_CONFIG(toolbutton)
#include <qtoolbutton.h>
+#endif
#if QT_CONFIG(tabbar)
#include <qtabbar.h>
#endif
@@ -2853,7 +2855,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
}
break;
#endif
-#ifndef QT_NO_TOOLBUTTON
+#if QT_CONFIG(toolbutton)
case CC_ToolButton:
if (const QStyleOptionToolButton *toolbutton
= qstyleoption_cast<const QStyleOptionToolButton *>(option)) {
@@ -2967,7 +2969,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
}
}
break;
-#endif // QT_NO_TOOLBUTTON
+#endif // QT_CONFIG(toolbutton)
case CC_TitleBar:
{