diff options
author | Stephan Binner <stephan.binner@basyskom.com> | 2017-03-08 20:11:43 +0100 |
---|---|---|
committer | Stephan Binner <stephan.binner@basyskom.com> | 2017-03-13 08:57:54 +0000 |
commit | d08deb0b4a64e24884eedaf5d8e20f967c38e82a (patch) | |
tree | efcb170e95d4a1af0413c7ea0f995d26a0f8b7dc /src/widgets/styles | |
parent | f06f1adb6cc3835793a15eafa2d5a3affad712a2 (diff) |
Add feature.abstractbutton
Change-Id: Ie93c6d0a8256bc466d3419408b753d5f3738aa6b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/widgets/styles')
-rw-r--r-- | src/widgets/styles/qfusionstyle.cpp | 13 | ||||
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 2 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsxpstyle.cpp | 10 |
3 files changed, 20 insertions, 5 deletions
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index 1267907303..02e0ad2a9b 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -45,7 +45,8 @@ #include <qcombobox.h> #if QT_CONFIG(pushbutton) #include <qpushbutton.h> -#else +#endif +#if QT_CONFIG(abstractbutton) #include <qabstractbutton.h> #endif #include <qpainter.h> @@ -3284,7 +3285,10 @@ void QFusionStyle::polish(QApplication *app) void QFusionStyle::polish(QWidget *widget) { QCommonStyle::polish(widget); - if (qobject_cast<QAbstractButton*>(widget) + if (false +#if QT_CONFIG(abstractbutton) + || qobject_cast<QAbstractButton*>(widget) +#endif #if QT_CONFIG(combobox) || qobject_cast<QComboBox *>(widget) #endif @@ -3325,7 +3329,10 @@ void QFusionStyle::polish(QPalette &pal) void QFusionStyle::unpolish(QWidget *widget) { QCommonStyle::unpolish(widget); - if (qobject_cast<QAbstractButton*>(widget) + if (false +#if QT_CONFIG(abstractbutton) + || qobject_cast<QAbstractButton*>(widget) +#endif #if QT_CONFIG(combobox) || qobject_cast<QComboBox *>(widget) #endif diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 275a0550d2..2886093732 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -4268,6 +4268,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op case PE_PanelButtonTool: case PE_PanelButtonCommand: +#if QT_CONFIG(abstractbutton) if (qobject_cast<const QAbstractButton *>(w) && rule.hasBackground() && rule.hasNativeBorder()) { //the window style will draw the borders ParentStyle::drawPrimitive(pe, opt, p, w); @@ -4276,6 +4277,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op } return; } +#endif if (!rule.hasNativeBorder()) { rule.drawRule(p, rule.boxRect(opt->rect, QRenderRule::Margin)); return; diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp index f3c6069f8a..b50c4b6be4 100644 --- a/src/widgets/styles/qwindowsxpstyle.cpp +++ b/src/widgets/styles/qwindowsxpstyle.cpp @@ -1139,7 +1139,10 @@ void QWindowsXPStyle::polish(QWidget *widget) if (!QWindowsXPStylePrivate::useXP()) return; - if (qobject_cast<QAbstractButton*>(widget) + if (false +#if QT_CONFIG(abstractbutton) + || qobject_cast<QAbstractButton*>(widget) +#endif || qobject_cast<QToolButton*>(widget) || qobject_cast<QTabBar*>(widget) #ifndef QT_NO_COMBOBOX @@ -1211,7 +1214,10 @@ void QWindowsXPStyle::unpolish(QWidget *widget) // already in the map might be old (other style). d->cleanupHandleMap(); } - if (qobject_cast<QAbstractButton*>(widget) + if (false +#if QT_CONFIG(abstractbutton) + || qobject_cast<QAbstractButton*>(widget) +#endif || qobject_cast<QToolButton*>(widget) || qobject_cast<QTabBar*>(widget) #ifndef QT_NO_COMBOBOX |