diff options
Diffstat (limited to 'src/widgets/styles')
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 23 | ||||
-rw-r--r-- | src/widgets/styles/qfusionstyle.cpp | 15 | ||||
-rw-r--r-- | src/widgets/styles/qpixmapstyle.cpp | 17 | ||||
-rw-r--r-- | src/widgets/styles/qstylehelper.cpp | 2 | ||||
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 4 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsstyle.cpp | 2 |
6 files changed, 59 insertions, 4 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 851b7a33c8..477d180a2b 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -416,6 +416,8 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q proxy()->drawItemPixmap(p, opt->rect, Qt::AlignCenter, pixmap); break; } +#else + Q_UNUSED(d); #endif // QT_NO_TABBAR case PE_FrameTabWidget: case PE_FrameWindow: @@ -2315,6 +2317,9 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, default: break; } +#if !QT_CONFIG(tabbar) && !QT_CONFIG(itemviews) + Q_UNUSED(d); +#endif } /*! @@ -3014,6 +3019,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, r = subElementRect(SE_CheckBoxIndicator, opt, widget); break; } + Q_FALLTHROUGH(); case SE_ItemViewItemDecoration: case SE_ItemViewItemText: case SE_ItemViewItemFocusRect: @@ -3058,6 +3064,9 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, break; } return r; +#if !QT_CONFIG(tabwidget) && !QT_CONFIG(itemviews) + Q_UNUSED(d); +#endif } #ifndef QT_NO_DIAL @@ -4186,11 +4195,13 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex case SC_TitleBarContextHelpButton: if (tb->titleBarFlags & Qt::WindowContextHelpButtonHint) offset += delta; + Q_FALLTHROUGH(); case SC_TitleBarMinButton: if (!isMinimized && (tb->titleBarFlags & Qt::WindowMinimizeButtonHint)) offset += delta; else if (sc == SC_TitleBarMinButton) break; + Q_FALLTHROUGH(); case SC_TitleBarNormalButton: if (isMinimized && (tb->titleBarFlags & Qt::WindowMinimizeButtonHint)) offset += delta; @@ -4198,21 +4209,25 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex offset += delta; else if (sc == SC_TitleBarNormalButton) break; + Q_FALLTHROUGH(); case SC_TitleBarMaxButton: if (!isMaximized && (tb->titleBarFlags & Qt::WindowMaximizeButtonHint)) offset += delta; else if (sc == SC_TitleBarMaxButton) break; + Q_FALLTHROUGH(); case SC_TitleBarShadeButton: if (!isMinimized && (tb->titleBarFlags & Qt::WindowShadeButtonHint)) offset += delta; else if (sc == SC_TitleBarShadeButton) break; + Q_FALLTHROUGH(); case SC_TitleBarUnshadeButton: if (isMinimized && (tb->titleBarFlags & Qt::WindowShadeButtonHint)) offset += delta; else if (sc == SC_TitleBarUnshadeButton) break; + Q_FALLTHROUGH(); case SC_TitleBarCloseButton: if (tb->titleBarFlags & Qt::WindowSystemMenuHint) offset += delta; @@ -4357,6 +4372,9 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex default: qWarning("QCommonStyle::subControlRect: Case %d not handled", cc); } +#if !QT_CONFIG(slider) && !QT_CONFIG(spinbox) && !QT_CONFIG(toolbutton) && !QT_CONFIG(groupbox) + Q_UNUSED(widget); +#endif return ret; } @@ -5278,6 +5296,7 @@ static inline QString clearText16IconPath() } #endif // !QT_NO_IMAGEFORMAT_PNG +#if defined(Q_OS_WIN) || QT_CONFIG(imageformat_png) static QIcon clearTextIcon(bool rtl) { const QString directionalThemeName = rtl @@ -5301,6 +5320,7 @@ static QIcon clearTextIcon(bool rtl) #endif // !QT_NO_IMAGEFORMAT_PNG return icon; } +#endif /*! \reimp */ QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *option, @@ -5645,6 +5665,9 @@ QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *opti } #endif //QT_NO_IMAGEFORMAT_XPM +#if !QT_CONFIG(imageformat_png) && !QT_CONFIG(imageformat_xpm) && !QT_CONFIG(imageformat_png) + Q_UNUSED(rtl); +#endif return QPixmap(); } diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index 98d45587f0..c874b12e45 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -908,8 +908,6 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem, return; } - BEGIN_STYLE_PIXMAPCACHE(QString::fromLatin1("pushbutton-%1").arg(isDefault)) - r = rect.adjusted(0, 1, -1, 0); bool isEnabled = option->state & State_Enabled; bool hasFocus = (option->state & State_HasFocus && option->state & State_KeyboardFocusChange); @@ -923,6 +921,9 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem, if (isDefault) buttonColor = mergedColors(buttonColor, highlightedOutline.lighter(130), 90); + BEGIN_STYLE_PIXMAPCACHE(QStringLiteral("pushbutton-") + buttonColor.name(QColor::HexArgb)) + r = rect.adjusted(0, 1, -1, 0); + p->setRenderHint(QPainter::Antialiasing, true); p->translate(0.5, -0.5); @@ -1953,9 +1954,13 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption Q_D (const QFusionStyle); +#if QT_CONFIG(spinbox) || QT_CONFIG(slider) QColor buttonColor = d->buttonColor(option->palette); +#endif +#if QT_CONFIG(slider) QColor gradientStartColor = buttonColor.lighter(118); QColor gradientStopColor = buttonColor; +#endif QColor outline = d->outline(option->palette); QColor alphaCornerColor; @@ -3575,11 +3580,13 @@ QRect QFusionStyle::subControlRect(ComplexControl control, const QStyleOptionCom case SC_TitleBarContextHelpButton: if (tb->titleBarFlags & Qt::WindowContextHelpButtonHint) offset += delta; + Q_FALLTHROUGH(); case SC_TitleBarMinButton: if (!isMinimized && (tb->titleBarFlags & Qt::WindowMinimizeButtonHint)) offset += delta; else if (sc == SC_TitleBarMinButton) break; + Q_FALLTHROUGH(); case SC_TitleBarNormalButton: if (isMinimized && (tb->titleBarFlags & Qt::WindowMinimizeButtonHint)) offset += delta; @@ -3587,21 +3594,25 @@ QRect QFusionStyle::subControlRect(ComplexControl control, const QStyleOptionCom offset += delta; else if (sc == SC_TitleBarNormalButton) break; + Q_FALLTHROUGH(); case SC_TitleBarMaxButton: if (!isMaximized && (tb->titleBarFlags & Qt::WindowMaximizeButtonHint)) offset += delta; else if (sc == SC_TitleBarMaxButton) break; + Q_FALLTHROUGH(); case SC_TitleBarShadeButton: if (!isMinimized && (tb->titleBarFlags & Qt::WindowShadeButtonHint)) offset += delta; else if (sc == SC_TitleBarShadeButton) break; + Q_FALLTHROUGH(); case SC_TitleBarUnshadeButton: if (isMinimized && (tb->titleBarFlags & Qt::WindowShadeButtonHint)) offset += delta; else if (sc == SC_TitleBarUnshadeButton) break; + Q_FALLTHROUGH(); case SC_TitleBarCloseButton: if (tb->titleBarFlags & Qt::WindowSystemMenuHint) offset += delta; diff --git a/src/widgets/styles/qpixmapstyle.cpp b/src/widgets/styles/qpixmapstyle.cpp index 19f4cc3617..de99b6ce7b 100644 --- a/src/widgets/styles/qpixmapstyle.cpp +++ b/src/widgets/styles/qpixmapstyle.cpp @@ -205,6 +205,9 @@ void QPixmapStyle::polish(QWidget *widget) if (qobject_cast<QScrollBar*>(widget)) widget->setAttribute(Qt::WA_OpaquePaintEvent, false); #endif +#if !QT_CONFIG(progressbar) && !QT_CONFIG(combobox) + Q_UNUSED(d); +#endif QCommonStyle::polish(widget); } @@ -929,6 +932,10 @@ void QPixmapStyle::drawSlider(const QStyleOptionComplex *option, painter->drawPixmap(handle, d->pixmaps.value(pix).pixmap); } } +#else + Q_UNUSED(option); + Q_UNUSED(painter); + Q_UNUSED(widget); #endif // QT_CONFIG(slider) } @@ -968,6 +975,10 @@ void QPixmapStyle::drawScrollBar(const QStyleOptionComplex *option, ? SB_Horizontal : SB_Vertical; drawCachedPixmap(control, rect, painter); } +#else + Q_UNUSED(option); + Q_UNUSED(painter); + Q_UNUSED(widget); #endif // QT_CONFIG(slider) } @@ -1044,6 +1055,9 @@ QSize QPixmapStyle::sliderSizeFromContents(const QStyleOption *option, else return QSize(desc.size.width(), result.height()); #else // QT_CONFIG(slider) + Q_UNUSED(option); + Q_UNUSED(contentsSize); + Q_UNUSED(widget); return QSize(); #endif // QT_CONFIG(slider) } @@ -1160,6 +1174,9 @@ QRect QPixmapStyle::scrollBarSubControlRect(const QStyleOptionComplex *option, } } } +#else + Q_UNUSED(option); + Q_UNUSED(sc); #endif // QT_CONFIG(slider) return QRect(); } diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp index b315c14858..6a5a27ed6d 100644 --- a/src/widgets/styles/qstylehelper.cpp +++ b/src/widgets/styles/qstylehelper.cpp @@ -415,6 +415,8 @@ QColor backgroundColor(const QPalette &pal, const QWidget* widget) if (qobject_cast<const QScrollBar *>(widget) && widget->parent() && qobject_cast<const QAbstractScrollArea *>(widget->parent()->parent())) return widget->parentWidget()->parentWidget()->palette().color(QPalette::Base); +#else + Q_UNUSED(widget); #endif return pal.color(QPalette::Base); } diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 260a660bf9..c6615a1945 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -4376,7 +4376,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op break; } #endif - //fall tghought + Q_FALLTHROUGH(); case PE_PanelMenu: case PE_PanelStatusBar: if(rule.hasDrawable()) { @@ -4935,7 +4935,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op case CT_ToolButton: if (rule.hasBox() || !rule.hasNativeBorder() || !rule.baseStyleCanDraw()) sz += QSize(3, 3); // ### broken QToolButton - //fall thought + Q_FALLTHROUGH(); case CT_ComboBox: case CT_PushButton: if (rule.hasBox() || !rule.hasNativeBorder()) { diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index 0ce8dde74c..b537931f49 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -1734,6 +1734,8 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai step = (animation->animationStep() / 3) % chunkCount; else d->startAnimation(new QProgressStyleAnimation(d->animationFps, opt->styleObject)); +#else + Q_UNUSED(d); #endif int chunksInRow = 5; int myY = pbBits.rect.y(); |