diff options
Diffstat (limited to 'src/widgets/styles/qfusionstyle.cpp')
-rw-r--r-- | src/widgets/styles/qfusionstyle.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index f1cd48556c..95fd0e5b2f 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -43,7 +43,11 @@ #if QT_CONFIG(style_fusion) || defined(QT_PLUGIN) #include "qcommonstyle_p.h" #include <qcombobox.h> +#if QT_CONFIG(pushbutton) #include <qpushbutton.h> +#else +#include <qabstractbutton.h> +#endif #include <qpainter.h> #include <qdir.h> #include <qstyleoption.h> @@ -52,9 +56,11 @@ #include <qfont.h> #include <qgroupbox.h> #include <qpixmapcache.h> -#include <qdialogbuttonbox.h> #include <qscrollbar.h> #include <qspinbox.h> +#if QT_CONFIG(abstractslider) +#include <qabstractslider.h> +#endif #include <qslider.h> #include <qsplitter.h> #include <qprogressbar.h> @@ -84,7 +90,7 @@ static const int windowsRightBorder = 15; // right border on windows static const int groupBoxBottomMargin = 0; // space below the groupbox static const int groupBoxTopMargin = 3; - +#if QT_CONFIG(imageformat_xpm) /* XPM */ static const char * const dock_widget_close_xpm[] = { "11 13 7 1", @@ -171,7 +177,7 @@ static const char * const qt_titlebar_context_help[] = { " ", " ## ", " ## "}; - +#endif // QT_CONFIG(imageformat_xpm) static QColor mergedColors(const QColor &colorA, const QColor &colorB, int factor = 50) { @@ -2366,6 +2372,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption bool hover = (titleBar->activeSubControls & SC_TitleBarContextHelpButton) && (titleBar->state & State_MouseOver); bool sunken = (titleBar->activeSubControls & SC_TitleBarContextHelpButton) && (titleBar->state & State_Sunken); qt_fusion_draw_mdibutton(painter, titleBar, contextHelpButtonRect, hover, sunken); +#if QT_CONFIG(imageformat_xpm) QImage image(qt_titlebar_context_help); QColor alpha = textColor; alpha.setAlpha(128); @@ -2373,6 +2380,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption image.setColor(2, alpha.rgba()); painter->setRenderHint(QPainter::SmoothPixmapTransform); painter->drawImage(contextHelpButtonRect.adjusted(4, 4, -4, -4), image); +#endif } } @@ -2435,7 +2443,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption int oldMin = styleObject->property("_q_stylemin").toInt(); int oldMax = styleObject->property("_q_stylemax").toInt(); QRect oldRect = styleObject->property("_q_stylerect").toRect(); - int oldState = styleObject->property("_q_stylestate").toInt(); + QStyle::State oldState = static_cast<QStyle::State>(styleObject->property("_q_stylestate").value<QStyle::State::Int>()); uint oldActiveControls = styleObject->property("_q_stylecontrols").toUInt(); // a scrollbar is transient when the the scrollbar itself and @@ -2458,7 +2466,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption styleObject->setProperty("_q_stylemin", scrollBar->minimum); styleObject->setProperty("_q_stylemax", scrollBar->maximum); styleObject->setProperty("_q_stylerect", scrollBar->rect); - styleObject->setProperty("_q_stylestate", static_cast<int>(scrollBar->state)); + styleObject->setProperty("_q_stylestate", static_cast<QStyle::State::Int>(scrollBar->state)); styleObject->setProperty("_q_stylecontrols", static_cast<uint>(scrollBar->activeSubControls)); #ifndef QT_NO_ANIMATION @@ -3287,7 +3295,9 @@ void QFusionStyle::polish(QWidget *widget) #if QT_CONFIG(splitter) || qobject_cast<QSplitterHandle *>(widget) #endif +#if QT_CONFIG(abstractslider) || qobject_cast<QAbstractSlider *>(widget) +#endif #if QT_CONFIG(spinbox) || qobject_cast<QAbstractSpinBox *>(widget) #endif @@ -3326,7 +3336,9 @@ void QFusionStyle::unpolish(QWidget *widget) #if QT_CONFIG(splitter) || qobject_cast<QSplitterHandle *>(widget) #endif +#if QT_CONFIG(abstractslider) || qobject_cast<QAbstractSlider *>(widget) +#endif #if QT_CONFIG(spinbox) || qobject_cast<QAbstractSpinBox *>(widget) #endif |