diff options
author | Sami Merilä <sami.merila@nokia.com> | 2009-05-29 07:46:40 (GMT) |
---|---|---|
committer | Sami Merilä <sami.merila@nokia.com> | 2009-05-29 07:46:40 (GMT) |
commit | dcf5d568aba893d690eedbe1e18148b504de2abb (patch) | |
tree | 535355923cce056963a576b72abba9a377466a41 /src | |
parent | a1ffc561aa6bbbdc1355119d5a43d17d0ff5c560 (diff) | |
download | Qt-dcf5d568aba893d690eedbe1e18148b504de2abb.zip Qt-dcf5d568aba893d690eedbe1e18148b504de2abb.tar.gz Qt-dcf5d568aba893d690eedbe1e18148b504de2abb.tar.bz2 |
S60Style: Remove unneeded case-statements and own implementation for drawItemText.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/styles/qs60style.cpp | 91 | ||||
-rw-r--r-- | src/gui/styles/qs60style.h | 1 | ||||
-rw-r--r-- | src/gui/styles/qs60style_p.h | 2 |
3 files changed, 0 insertions, 94 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index b0ba30b..930602b 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -1111,15 +1111,6 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom } break; #endif //QT_NO_GROUPBOX -#ifndef QT_NO_DIAL - case CC_Dial: - if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) { - QStyleOptionSlider optionSlider = *slider; - QCommonStyle::drawComplexControl(control, &optionSlider, painter, widget); - } - break; -#endif //QT_NO_DIAL - default: QCommonStyle::drawComplexControl(control, option, painter, widget); } @@ -1177,24 +1168,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags); } break; - case CE_PushButtonLabel: - if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(option)) { - QStyleOptionButton optionButton = *button; - QCommonStyle::drawControl(element, &optionButton, painter, widget); - } - break; - case CE_CheckBoxLabel: - if (const QStyleOptionButton *checkBox = qstyleoption_cast<const QStyleOptionButton *>(option)) { - QStyleOptionButton optionCheckBox = *checkBox; - QCommonStyle::drawControl(element, &optionCheckBox, painter, widget); - } - break; - case CE_RadioButtonLabel: - if (const QStyleOptionButton *radioButton = qstyleoption_cast<const QStyleOptionButton *>(option)) { - QStyleOptionButton optionRadioButton = *radioButton; - QCommonStyle::drawControl(element, &optionRadioButton, painter, widget); - } - break; #ifndef QT_NO_TOOLBUTTON case CE_ToolButtonLabel: if (const QStyleOptionToolButton *toolBtn = qstyleoption_cast<const QStyleOptionToolButton *>(option)) { @@ -1213,12 +1186,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, } break; #endif //QT_NO_TOOLBUTTON - case CE_HeaderLabel: - if (const QStyleOptionHeader *headerLabel = qstyleoption_cast<const QStyleOptionHeader *>(option)) { - QStyleOptionHeader optionHeaderLabel = *headerLabel; - QCommonStyle::drawControl(element, &optionHeaderLabel, painter, widget); - } - break; #ifndef QT_NO_COMBOBOX case CE_ComboBoxLabel: if (const QStyleOptionComboBox *comboBox = qstyleoption_cast<const QStyleOptionComboBox *>(option)) { @@ -1580,12 +1547,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, break; #endif // QT_NO_PROGRESSBAR #ifndef QT_NO_MENUBAR - case CE_MenuBarItem: - if (const QStyleOptionMenuItem *menuBarItem = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) { - QStyleOptionMenuItem optionMenuBarItem = *menuBarItem; - QCommonStyle::drawControl(element, &optionMenuBarItem, painter, widget); - } - break; #endif //QT_NO_MENUBAR #ifndef QT_NO_MENU case CE_MenuItem: @@ -1798,49 +1759,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, } break; #endif //QT_NO_TOOLBAR - - //todo: remove non-used widgets in final version - case CE_ShapedFrame: - case CE_MenuVMargin: - case CE_MenuHMargin: -#ifndef QT_NO_MENU - case CE_MenuScroller: - case CE_MenuTearoff: -#endif //QT_NO_MENU - - case CE_CheckBox: - case CE_RadioButton: -#ifndef QT_NO_TABBAR - case CE_TabBarTab: -#endif //QT_NO_TABBAR -#ifndef QT_NO_PROGRESSBAR - case CE_ProgressBar: -#endif // QT_NO_PROGRESSBAR - case CE_Q3DockWindowEmptyArea: -#ifndef QT_NO_SIZEGRIP - case CE_SizeGrip: -#endif //QT_NO_SIZEGRIP - case CE_Splitter: -#ifndef QT_NO_RUBBERBAND - case CE_RubberBand: -#endif //QT_NO_RUBBERBAND -#ifndef QT_NO_DOCKWIDGET - case CE_DockWidgetTitle: -#endif //QT_NO_DOCKWIDGET - case CE_ScrollBarAddLine: - case CE_ScrollBarSubLine: - case CE_ScrollBarAddPage: - case CE_ScrollBarSubPage: - case CE_ScrollBarSlider: - case CE_ScrollBarFirst: - case CE_ScrollBarLast: - case CE_FocusFrame: -#ifndef QT_NO_TOOLBOX - case CE_ToolBoxTab: - case CE_ToolBoxTabShape: - case CE_ToolBoxTabLabel: -#endif //QT_NO_TOOLBOX - case CE_ColumnViewGrip: default: QCommonStyle::drawControl(element, option, painter, widget); } @@ -2169,15 +2087,6 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti } /*! - \reimp - sets the default colors -*/ -void QS60Style::drawItemText(QPainter *painter, const QRect &rectangle, int alignment, const QPalette & palette, bool enabled, const QString &text, QPalette::ColorRole textRole) const -{ - QPalette override = palette; - QCommonStyle::drawItemText(painter, rectangle, alignment, override, enabled, text, textRole); -} - -/*! \reimp */ int QS60Style::pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const diff --git a/src/gui/styles/qs60style.h b/src/gui/styles/qs60style.h index 945e182..09c6b00 100644 --- a/src/gui/styles/qs60style.h +++ b/src/gui/styles/qs60style.h @@ -36,7 +36,6 @@ public: void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget = 0) const; void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const; void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const; - void drawItemText(QPainter *painter, const QRect &rectangle, int alignment, const QPalette &palette, bool enabled, const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const; int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const; QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w = 0) const; int styleHint(StyleHint sh, const QStyleOption *opt = 0, const QWidget *w = 0, diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index 22b01f6..c93d271 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -366,8 +366,6 @@ public: static QColor lighterColor(const QColor &baseColor); //deduces if the given widget should have separately themeable background static bool drawsOwnThemeBackground(const QWidget *widget); - // gets layout - static const QHash<QStyle::PixelMetric, int> &s60StyleLayout(); QFont s60Font(QS60StyleEnums::FontCategories fontCategory, int pointSize = -1) const; |