diff options
Diffstat (limited to 'src/widgets/styles')
-rw-r--r-- | src/widgets/styles/qcleanlooksstyle.cpp | 2 | ||||
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 121 | ||||
-rw-r--r-- | src/widgets/styles/qmacstyle_mac.mm | 66 | ||||
-rw-r--r-- | src/widgets/styles/qmotifstyle.cpp | 148 | ||||
-rw-r--r-- | src/widgets/styles/qplastiquestyle.cpp | 13 | ||||
-rw-r--r-- | src/widgets/styles/qstyle.cpp | 48 | ||||
-rw-r--r-- | src/widgets/styles/qstyle.h | 31 | ||||
-rw-r--r-- | src/widgets/styles/qstyleoption.cpp | 388 | ||||
-rw-r--r-- | src/widgets/styles/qstyleoption.h | 68 | ||||
-rw-r--r-- | src/widgets/styles/qwindowscestyle.cpp | 5 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsmobilestyle.cpp | 5 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsstyle.cpp | 3 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsxpstyle.cpp | 111 |
13 files changed, 26 insertions, 983 deletions
diff --git a/src/widgets/styles/qcleanlooksstyle.cpp b/src/widgets/styles/qcleanlooksstyle.cpp index 67b3c59b29..d617ee7e6f 100644 --- a/src/widgets/styles/qcleanlooksstyle.cpp +++ b/src/widgets/styles/qcleanlooksstyle.cpp @@ -3906,7 +3906,6 @@ void QCleanlooksStyle::polish(QWidget *widget) #ifndef QT_NO_SPINBOX || qobject_cast<QAbstractSpinBox *>(widget) #endif - || (widget->inherits("QWorkspaceChild")) || (widget->inherits("QDockSeparator")) || (widget->inherits("QDockWidgetSeparator")) ) { @@ -3953,7 +3952,6 @@ void QCleanlooksStyle::unpolish(QWidget *widget) #ifndef QT_NO_SPINBOX || qobject_cast<QAbstractSpinBox *>(widget) #endif - || (widget->inherits("QWorkspaceChild")) || (widget->inherits("QDockSeparator")) || (widget->inherits("QDockWidgetSeparator")) ) { diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 68d80931f6..b2b1d3fec5 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -460,9 +460,6 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q } p->restore(); break; - case PE_Q3DockWindowSeparator: - proxy()->drawPrimitive(PE_IndicatorToolBarSeparator, opt, p, widget); - break; case PE_IndicatorToolBarSeparator: { QPoint p1, p2; @@ -3571,69 +3568,6 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl } break; #endif // QT_NO_GROUPBOX -#ifndef QT_NO_WORKSPACE - case CC_MdiControls: - { - QStyleOptionButton btnOpt; - btnOpt.QStyleOption::operator=(*opt); - btnOpt.state &= ~State_MouseOver; - int bsx = 0; - int bsy = 0; - if (opt->subControls & QStyle::SC_MdiCloseButton) { - if (opt->activeSubControls & QStyle::SC_MdiCloseButton && (opt->state & State_Sunken)) { - btnOpt.state |= State_Sunken; - btnOpt.state &= ~State_Raised; - bsx = proxy()->pixelMetric(PM_ButtonShiftHorizontal); - bsy = proxy()->pixelMetric(PM_ButtonShiftVertical); - } else { - btnOpt.state |= State_Raised; - btnOpt.state &= ~State_Sunken; - bsx = 0; - bsy = 0; - } - btnOpt.rect = proxy()->subControlRect(CC_MdiControls, opt, SC_MdiCloseButton, widget); - proxy()->drawPrimitive(PE_PanelButtonCommand, &btnOpt, p, widget); - QPixmap pm = standardIcon(SP_TitleBarCloseButton).pixmap(16, 16); - proxy()->drawItemPixmap(p, btnOpt.rect.translated(bsx, bsy), Qt::AlignCenter, pm); - } - if (opt->subControls & QStyle::SC_MdiNormalButton) { - if (opt->activeSubControls & QStyle::SC_MdiNormalButton && (opt->state & State_Sunken)) { - btnOpt.state |= State_Sunken; - btnOpt.state &= ~State_Raised; - bsx = proxy()->pixelMetric(PM_ButtonShiftHorizontal); - bsy = proxy()->pixelMetric(PM_ButtonShiftVertical); - } else { - btnOpt.state |= State_Raised; - btnOpt.state &= ~State_Sunken; - bsx = 0; - bsy = 0; - } - btnOpt.rect = proxy()->subControlRect(CC_MdiControls, opt, SC_MdiNormalButton, widget); - proxy()->drawPrimitive(PE_PanelButtonCommand, &btnOpt, p, widget); - QPixmap pm = standardIcon(SP_TitleBarNormalButton).pixmap(16, 16); - proxy()->drawItemPixmap(p, btnOpt.rect.translated(bsx, bsy), Qt::AlignCenter, pm); - } - if (opt->subControls & QStyle::SC_MdiMinButton) { - if (opt->activeSubControls & QStyle::SC_MdiMinButton && (opt->state & State_Sunken)) { - btnOpt.state |= State_Sunken; - btnOpt.state &= ~State_Raised; - bsx = proxy()->pixelMetric(PM_ButtonShiftHorizontal); - bsy = proxy()->pixelMetric(PM_ButtonShiftVertical); - } else { - btnOpt.state |= State_Raised; - btnOpt.state &= ~State_Sunken; - bsx = 0; - bsy = 0; - } - btnOpt.rect = proxy()->subControlRect(CC_MdiControls, opt, SC_MdiMinButton, widget); - proxy()->drawPrimitive(PE_PanelButtonCommand, &btnOpt, p, widget); - QPixmap pm = standardIcon(SP_TitleBarMinButton).pixmap(16, 16); - proxy()->drawItemPixmap(p, btnOpt.rect.translated(bsx, bsy), Qt::AlignCenter, pm); - } - } - break; -#endif // QT_NO_WORKSPACE - default: qWarning("QCommonStyle::drawComplexControl: Control %d not handled", cc); } @@ -4106,10 +4040,8 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex } int frameWidth = 0; - if (!(widget && widget->inherits("Q3GroupBox")) - && ((groupBox->features & QStyleOptionFrameV2::Flat) == 0)) { + if ((groupBox->features & QStyleOptionFrameV2::Flat) == 0) frameWidth = proxy()->pixelMetric(PM_DefaultFrameWidth, groupBox, widget); - } ret = frameRect.adjusted(frameWidth, frameWidth + topHeight - topMargin, -frameWidth, -frameWidth); break; @@ -4160,50 +4092,6 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex break; } #endif // QT_NO_GROUPBOX -#ifndef QT_NO_WORKSPACE - case CC_MdiControls: - { - int numSubControls = 0; - if (opt->subControls & SC_MdiCloseButton) - ++numSubControls; - if (opt->subControls & SC_MdiMinButton) - ++numSubControls; - if (opt->subControls & SC_MdiNormalButton) - ++numSubControls; - if (numSubControls == 0) - break; - - int buttonWidth = opt->rect.width()/ numSubControls - 1; - int offset = 0; - switch (sc) { - case SC_MdiCloseButton: - // Only one sub control, no offset needed. - if (numSubControls == 1) - break; - offset += buttonWidth + 2; - //FALL THROUGH - case SC_MdiNormalButton: - // No offset needed if - // 1) There's only one sub control - // 2) We have a close button and a normal button (offset already added in SC_MdiClose) - if (numSubControls == 1 || (numSubControls == 2 && !(opt->subControls & SC_MdiMinButton))) - break; - if (opt->subControls & SC_MdiNormalButton) - offset += buttonWidth; - break; - default: - break; - } - - // Subtract one pixel if we only have one sub control. At this point - // buttonWidth is the actual width + 1 pixel margin, but we don't want the - // margin when there are no other controllers. - if (numSubControls == 1) - --buttonWidth; - ret = QRect(offset, 0, buttonWidth, opt->rect.height()); - break; - } -#endif // QT_NO_WORKSPACE default: qWarning("QCommonStyle::subControlRect: Case %d not handled", cc); } @@ -4233,10 +4121,6 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid case PM_DialogButtonsButtonHeight: ret = int(QStyleHelper::dpiScaled(30.)); break; - case PM_CheckListControllerSize: - case PM_CheckListButtonSize: - ret = int(QStyleHelper::dpiScaled(16.)); - break; case PM_TitleBarHeight: { if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) { if ((tb->titleBarFlags & Qt::WindowType_Mask) == Qt::Tool) { @@ -4711,7 +4595,6 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, case CT_MenuBar: case CT_Menu: case CT_MenuBarItem: - case CT_Q3Header: case CT_Slider: case CT_ProgressBar: case CT_TabBarTab: @@ -4756,7 +4639,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget break; #endif // QT_NO_GROUPBOX - case SH_Q3ListViewExpand_SelectMouseType: + case SH_ListViewExpand_SelectMouseType: case SH_TabBar_SelectMouseType: ret = QEvent::MouseButtonPress; break; diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 8496abab91..05bd90abef 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -2145,20 +2145,6 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW else ret = sz.height(); break; } - case PM_CheckListButtonSize: { - switch (d->aquaSizeConstrain(opt, widget)) { - case QAquaSizeUnknown: - case QAquaSizeLarge: - GetThemeMetric(kThemeMetricCheckBoxWidth, &ret); - break; - case QAquaSizeMini: - GetThemeMetric(kThemeMetricMiniCheckBoxWidth, &ret); - break; - case QAquaSizeSmall: - GetThemeMetric(kThemeMetricSmallCheckBoxWidth, &ret); - break; - } - break; } case PM_DialogButtonsButtonWidth: { QSize sz; ret = d->aquaSizeConstrain(opt, 0, QStyle::CT_PushButton, QSize(-1, -1), &sz); @@ -2198,8 +2184,7 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW if (widget && (widget->isWindow() || !widget->parentWidget() || (qobject_cast<const QMainWindow*>(widget->parentWidget()) && static_cast<QMainWindow *>(widget->parentWidget())->centralWidget() == widget)) - && (qobject_cast<const QAbstractScrollArea *>(widget) - || widget->inherits("QWorkspaceChild"))) + && qobject_cast<const QAbstractScrollArea *>(widget)) ret = 0; else #endif @@ -2561,12 +2546,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w ret = Qt::AlignTop; break; case SH_ScrollView_FrameOnlyAroundContents: - if (w && (w->isWindow() || !w->parentWidget() || w->parentWidget()->isWindow()) - && (w->inherits("QWorkspaceChild") - )) - ret = true; - else - ret = QWindowsStyle::styleHint(sh, opt, w, hret); + ret = QWindowsStyle::styleHint(sh, opt, w, hret); break; case SH_Menu_FillScreenWithScroll: ret = false; @@ -2583,7 +2563,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w case SH_ScrollBar_StopMouseOverSlider: ret = true; break; - case SH_Q3ListViewExpand_SelectMouseType: + case SH_ListViewExpand_SelectMouseType: ret = QEvent::MouseButtonRelease; break; case SH_TabBar_SelectMouseType: @@ -3094,8 +3074,6 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai p->restore(); break; } case PE_IndicatorViewItemCheck: - case PE_Q3CheckListExclusiveIndicator: - case PE_Q3CheckListIndicator: case PE_IndicatorRadioButton: case PE_IndicatorCheckBox: { bool drawColorless = (!(opt->state & State_Active)) @@ -3108,8 +3086,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai bdi.adornment = kThemeDrawIndicatorOnly; if (opt->state & State_HasFocus) bdi.adornment |= kThemeAdornmentFocus; - bool isRadioButton = (pe == PE_Q3CheckListExclusiveIndicator - || pe == PE_IndicatorRadioButton); + bool isRadioButton = (pe == PE_IndicatorRadioButton); switch (d->aquaSizeConstrain(opt, w)) { case QAquaSizeUnknown: case QAquaSizeLarge: @@ -3137,11 +3114,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai bdi.value = kThemeButtonOn; else bdi.value = kThemeButtonOff; - HIRect macRect; - if (pe == PE_Q3CheckListExclusiveIndicator || pe == PE_Q3CheckListIndicator) - macRect = qt_hirectForQRect(opt->rect); - else - macRect = qt_hirectForQRect(opt->rect); + HIRect macRect = qt_hirectForQRect(opt->rect); if (!drawColorless) HIThemeDrawButton(&macRect, &bdi, cg, kHIThemeOrientationNormal, 0); else @@ -4931,35 +4904,6 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex } } break; - case CC_Q3ListView: - if (const QStyleOptionQ3ListView *lv = qstyleoption_cast<const QStyleOptionQ3ListView *>(opt)) { - if (lv->subControls & SC_Q3ListView) - QWindowsStyle::drawComplexControl(cc, lv, p, widget); - if (lv->subControls & (SC_Q3ListViewBranch | SC_Q3ListViewExpand)) { - int y = lv->rect.y(); - int h = lv->rect.height(); - int x = lv->rect.right() - 10; - for (int i = 1; i < lv->items.size() && y < h; ++i) { - QStyleOptionQ3ListViewItem item = lv->items.at(i); - if (y + item.height > 0 && (item.childCount > 0 - || (item.features & (QStyleOptionQ3ListViewItem::Expandable - | QStyleOptionQ3ListViewItem::Visible)) - == (QStyleOptionQ3ListViewItem::Expandable - | QStyleOptionQ3ListViewItem::Visible))) { - QStyleOption treeOpt(0); - treeOpt.rect.setRect(x, y + item.height / 2 - 4, 9, 9); - treeOpt.palette = lv->palette; - treeOpt.state = lv->state; - treeOpt.state |= State_Children; - if (item.state & State_Open) - treeOpt.state |= State_Open; - proxy()->drawPrimitive(PE_IndicatorBranch, &treeOpt, p, widget); - } - y += item.totalHeight; - } - } - } - break; case CC_SpinBox: if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) { QStyleOptionSpinBox newSB = *sb; diff --git a/src/widgets/styles/qmotifstyle.cpp b/src/widgets/styles/qmotifstyle.cpp index 331b70f153..f02771ab61 100644 --- a/src/widgets/styles/qmotifstyle.cpp +++ b/src/widgets/styles/qmotifstyle.cpp @@ -346,41 +346,6 @@ void QMotifStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QP const QWidget *w) const { switch(pe) { - case PE_Q3CheckListExclusiveIndicator: - if (const QStyleOptionQ3ListView *lv = qstyleoption_cast<const QStyleOptionQ3ListView *>(opt)) { - if (lv->items.isEmpty()) - return; - - if (lv->state & State_Enabled) - p->setPen(QPen(opt->palette.text().color())); - else - p->setPen(QPen(lv->palette.color(QPalette::Disabled, QPalette::Text))); - QPolygon a; - - int cx = opt->rect.width()/2 - 1; - int cy = opt->rect.height()/2; - int e = opt->rect.width()/2 - 1; - for (int i = 0; i < 3; i++) { //penWidth 2 doesn't quite work - a.setPoints(4, cx-e, cy, cx, cy-e, cx+e, cy, cx, cy+e); - p->drawPolygon(a); - e--; - } - if (opt->state & State_On) { - if (lv->state & State_Enabled) - p->setPen(QPen(opt->palette.text().color())); - else - p->setPen(QPen(lv->palette.color(QPalette::Disabled, - QPalette::Text))); - QBrush saveBrush = p->brush(); - p->setBrush(opt->palette.text()); - e = e - 2; - a.setPoints(4, cx-e, cy, cx, cy-e, cx+e, cy, cx, cy+e); - p->drawPolygon(a); - p->setBrush(saveBrush); - } - } - break; - case PE_FrameTabWidget: case PE_FrameWindow: qDrawShadePanel(p, opt->rect, opt->palette, QStyle::State_None, proxy()->pixelMetric(PM_DefaultFrameWidth)); @@ -1672,105 +1637,6 @@ void QMotifStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComple break; } #endif - case CC_Q3ListView: - if (opt->subControls & (SC_Q3ListViewBranch | SC_Q3ListViewExpand)) { - int i; - if (opt->subControls & SC_Q3ListView) - QCommonStyle::drawComplexControl(cc, opt, p, widget); - if (const QStyleOptionQ3ListView *lv = qstyleoption_cast<const QStyleOptionQ3ListView *>(opt)) { - QStyleOptionQ3ListViewItem item = lv->items.at(0); - int y = opt->rect.y(); - int c; - QPolygon dotlines; - if ((opt->activeSubControls & SC_All) && (opt->subControls & SC_Q3ListViewExpand)) { - c = 2; - dotlines.resize(2); - dotlines[0] = QPoint(opt->rect.right(), opt->rect.top()); - dotlines[1] = QPoint(opt->rect.right(), opt->rect.bottom()); - } else { - int linetop = 0, linebot = 0; - // each branch needs at most two lines, ie. four end points - dotlines.resize(item.childCount * 4); - c = 0; - - // skip the stuff above the exposed rectangle - for (i = 1; i < lv->items.size(); ++i) { - QStyleOptionQ3ListViewItem child = lv->items.at(i); - if (child.height + y > 0) - break; - y += child.totalHeight; - } - - int bx = opt->rect.width() / 2; - - // paint stuff in the magical area - while (i < lv->items.size() && y < lv->rect.height()) { - QStyleOptionQ3ListViewItem child = lv->items.at(i); - if (child.features & QStyleOptionQ3ListViewItem::Visible) { - int lh; - if (!(item.features & QStyleOptionQ3ListViewItem::MultiLine)) - lh = child.height; - else - lh = p->fontMetrics().height() + 2 * lv->itemMargin; - lh = qMax(lh, QApplication::globalStrut().height()); - if (lh % 2 > 0) - lh++; - linebot = y + lh/2; - if ((child.features & QStyleOptionQ3ListViewItem::Expandable || child.childCount > 0) && - child.height > 0) { - // needs a box - p->setPen(opt->palette.text().color()); - p->drawRect(bx-4, linebot-4, 9, 9); - QPolygon a; - if ((child.state & State_Open)) - a.setPoints(3, bx-2, linebot-2, - bx, linebot+2, - bx+2, linebot-2); //Qt::RightArrow - else - a.setPoints(3, bx-2, linebot-2, - bx+2, linebot, - bx-2, linebot+2); //Qt::DownArrow - p->setBrush(opt->palette.text()); - p->drawPolygon(a); - p->setBrush(Qt::NoBrush); - // dotlinery - dotlines[c++] = QPoint(bx, linetop); - dotlines[c++] = QPoint(bx, linebot - 5); - dotlines[c++] = QPoint(bx + 5, linebot); - dotlines[c++] = QPoint(opt->rect.width(), linebot); - linetop = linebot + 5; - } else { - // just dotlinery - dotlines[c++] = QPoint(bx+1, linebot); - dotlines[c++] = QPoint(opt->rect.width(), linebot); - } - y += child.totalHeight; - } - ++i; - } - - // Expand line height to edge of rectangle if there's any - // visible child below - while (i < lv->items.size() && lv->items.at(i).height <= 0) - ++i; - if (i < lv->items.size()) - linebot = opt->rect.height(); - - if (linetop < linebot) { - dotlines[c++] = QPoint(bx, linetop); - dotlines[c++] = QPoint(bx, linebot); - } - } - - int line; // index into dotlines - p->setPen(opt->palette.text().color()); - if (opt->subControls & SC_Q3ListViewBranch) for(line = 0; line < c; line += 2) { - p->drawLine(dotlines[line].x(), dotlines[line].y(), - dotlines[line+1].x(), dotlines[line+1].y()); - } - } - break; } - default: QCommonStyle::drawComplexControl(cc, opt, p, widget); break; @@ -2123,20 +1989,6 @@ QMotifStyle::subElementRect(SubElement sr, const QStyleOption *opt, const QWidge break; } - case SE_Q3DockWindowHandleRect: - if (const QStyleOptionQ3DockWindow *dw = qstyleoption_cast<const QStyleOptionQ3DockWindow *>(opt)) { - if (!dw->docked || !dw->closeEnabled) - rect.setRect(0, 0, opt->rect.width(), opt->rect.height()); - else { - if (dw->state == State_Horizontal) - rect.setRect(2, 15, opt->rect.width()-2, opt->rect.height() - 15); - else - rect.setRect(0, 2, opt->rect.width() - 15, opt->rect.height() - 2); - } - rect = visualRect(dw->direction, dw->rect, rect); - } - break; - case SE_ProgressBarLabel: case SE_ProgressBarGroove: case SE_ProgressBarContents: diff --git a/src/widgets/styles/qplastiquestyle.cpp b/src/widgets/styles/qplastiquestyle.cpp index 79893f066d..cae015ff82 100644 --- a/src/widgets/styles/qplastiquestyle.cpp +++ b/src/widgets/styles/qplastiquestyle.cpp @@ -83,7 +83,6 @@ static const int blueFrameWidth = 2; // with of line edit focus frame #include <qtoolbar.h> #include <qtoolbox.h> #include <qtoolbutton.h> -#include <qworkspace.h> #include <qprocess.h> #include <qvarlengtharray.h> #include <limits.h> @@ -5629,10 +5628,8 @@ void QPlastiqueStyle::polish(QWidget *widget) widget->setAttribute(Qt::WA_Hover); } - if (widget->inherits("QWorkspaceTitleBar") - || widget->inherits("QDockSeparator") - || widget->inherits("QDockWidgetSeparator") - || widget->inherits("Q3DockWindowResizeHandle")) { + if (widget->inherits("QDockSeparator") + || widget->inherits("QDockWidgetSeparator")) { widget->setAttribute(Qt::WA_Hover); } @@ -5685,10 +5682,8 @@ void QPlastiqueStyle::unpolish(QWidget *widget) widget->setAttribute(Qt::WA_Hover, false); } - if (widget->inherits("QWorkspaceTitleBar") - || widget->inherits("QDockSeparator") - || widget->inherits("QDockWidgetSeparator") - || widget->inherits("Q3DockWindowResizeHandle")) { + if (widget->inherits("QDockSeparator") + || widget->inherits("QDockWidgetSeparator")) { widget->setAttribute(Qt::WA_Hover, false); } diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp index db387fecec..d78a2ee2fb 100644 --- a/src/widgets/styles/qstyle.cpp +++ b/src/widgets/styles/qstyle.cpp @@ -596,8 +596,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value PE_IndicatorCheckBox On/off indicator, for example, a QCheckBox. \value PE_IndicatorRadioButton Exclusive on/off indicator, for example, a QRadioButton. - \value PE_Q3DockWindowSeparator Item separator for Qt 3 compatible dock window - and toolbar contents. \value PE_IndicatorDockWidgetResizeHandle Resize handle for dock windows. \value PE_Frame Generic frame @@ -619,16 +617,10 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value PE_FrameWindow Frame around a MDI window or a docking window. - \value PE_Q3Separator Qt 3 compatible generic separator. - \value PE_IndicatorMenuCheckMark Check mark used in a menu. \value PE_IndicatorProgressChunk Section of a progress bar indicator; see also QProgressBar. - \value PE_Q3CheckListController Qt 3 compatible controller part of a list view item. - \value PE_Q3CheckListIndicator Qt 3 compatible checkbox part of a list view item. - \value PE_Q3CheckListExclusiveIndicator Qt 3 compatible radio button part of a list view item. - \value PE_IndicatorBranch Lines used to represent the branch of a tree in a tree view. \value PE_IndicatorToolBarHandle The handle of a toolbar. \value PE_IndicatorToolBarSeparator The separator in a toolbar. @@ -740,9 +732,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \row \li \l State_On \li Indicates the indicator is checked. \row \li \l PE_IndicatorRadioButton \li \l QStyleOptionButton \li \l State_On \li Indicates that a radio button is selected. - \row \li{1,3} \l PE_Q3CheckListExclusiveIndicator, \l PE_Q3CheckListIndicator - \li{1,3} \l QStyleOptionQ3ListView \li \l State_On - \li Indicates whether or not the controller is selected. \row \li \l State_NoChange \li Indicates a "tri-state" controller. \row \li \l State_Enabled \li Indicates the controller is enabled. \row \li{1,4} \l PE_IndicatorBranch \li{1,4} \l QStyleOption @@ -760,9 +749,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \row \li \l PE_IndicatorToolBarHandle \li \l QStyleOption \li \l State_Horizontal \li Indicates that the window handle is horizontal instead of vertical. - \row \li \l PE_Q3DockWindowSeparator \li \l QStyleOption - \li \l State_Horizontal \li Indicates that the separator is horizontal - instead of vertical. \row \li \l PE_IndicatorSpinPlus, \l PE_IndicatorSpinMinus, \l PE_IndicatorSpinUp, \l PE_IndicatorSpinDown, \li \l QStyleOptionSpinBox @@ -826,8 +812,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value CE_MenuHMargin The horizontal extra space on the left/right of a menu. \value CE_MenuVMargin The vertical extra space on the top/bottom of a menu. - \value CE_Q3DockWindowEmptyArea The empty area of a QDockWidget. - \value CE_ToolBoxTab The toolbox's tab and label within a QToolBox. \value CE_SizeGrip Window resize handle; see also QSizeGrip. @@ -988,22 +972,11 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value SE_SpinBoxLayoutItem Area that counts for the parent layout. - \value SE_Q3DockWindowHandleRect Area for the tear-off handle. - \value SE_ProgressBarGroove Area for the groove. \value SE_ProgressBarContents Area for the progress indicator. \value SE_ProgressBarLabel Area for the text label. \value SE_ProgressBarLayoutItem Area that counts for the parent layout. - \omitvalue SE_DialogButtonAccept - \omitvalue SE_DialogButtonReject - \omitvalue SE_DialogButtonApply - \omitvalue SE_DialogButtonHelp - \omitvalue SE_DialogButtonAll - \omitvalue SE_DialogButtonRetry - \omitvalue SE_DialogButtonAbort - \omitvalue SE_DialogButtonIgnore - \omitvalue SE_DialogButtonCustom \omitvalue SE_ViewItemCheckIndicator \value SE_FrameContents Area for a frame's contents. @@ -1087,7 +1060,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \row \li \l SE_RadioButtonContents \li \l QStyleOptionButton \row \li \l SE_RadioButtonFocusRect \li \l QStyleOptionButton \row \li \l SE_ComboBoxFocusRect \li \l QStyleOptionComboBox - \row \li \l SE_Q3DockWindowHandleRect \li \l QStyleOptionQ3DockWindow \row \li \l SE_ProgressBarGroove \li \l QStyleOptionProgressBar \row \li \l SE_ProgressBarContents \li \l QStyleOptionProgressBar \row \li \l SE_ProgressBarLabel \li \l QStyleOptionProgressBar @@ -1107,7 +1079,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value CC_Slider A slider, like QSlider. \value CC_ToolButton A tool button, like QToolButton. \value CC_TitleBar A Title bar, like those used in QMdiSubWindow. - \value CC_Q3ListView Used for drawing the Q3ListView class. \value CC_GroupBox A group box, like QGroupBox. \value CC_Dial A dial, like QDial. \value CC_MdiControls The minimize, close, and normal @@ -1157,7 +1128,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value SC_ToolButton Tool button (see also QToolButton). \value SC_ToolButtonMenu Sub-control for opening a popup menu in a - tool button; see also Q3PopupMenu. + tool button. \value SC_TitleBarSysMenu System menu button (i.e., restore, close, etc.). \value SC_TitleBarMinButton Minimize button. @@ -1169,9 +1140,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value SC_TitleBarUnshadeButton Unshade button. \value SC_TitleBarContextHelpButton Context Help button. - \value SC_Q3ListView The list view area. - \value SC_Q3ListViewExpand Expand item (i.e., show/hide child items). - \value SC_DialHandle The handle of the dial (i.e. what you use to control the dial). \value SC_DialGroove The groove for the dial. \value SC_DialTickmarks The tickmarks for the dial. @@ -1189,7 +1157,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, in the menu bar. \value SC_All Special value that matches all sub-controls. - \omitvalue SC_Q3ListViewBranch \omitvalue SC_CustomBase \sa ComplexControl @@ -1257,9 +1224,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \row \li \l{CC_TitleBar} \li \l QStyleOptionTitleBar \li \l State_Enabled \li Set if the title bar is enabled. - \row \li \l{CC_Q3ListView} \li \l QStyleOptionQ3ListView - \li \l State_Enabled \li Set if the list view is enabled. - \endtable \sa drawPrimitive(), drawControl() @@ -1418,11 +1382,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value PM_MenuTearoffHeight Height of a tear off area in a QMenu. \value PM_MenuDesktopFrameWidth The frame width for the menu on the desktop. - \value PM_CheckListButtonSize Area (width/height) of the - checkbox/radio button in a Q3CheckListItem. - \value PM_CheckListControllerSize Area (width/height) of the - controller in a Q3CheckListItem. - \omitvalue PM_DialogButtonsSeparator \omitvalue PM_DialogButtonsButtonWidth \omitvalue PM_DialogButtonsButtonHeight @@ -1520,11 +1479,9 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value CT_CheckBox A check box, like QCheckBox. \value CT_ComboBox A combo box, like QComboBox. \omitvalue CT_DialogButtons - \value CT_Q3DockWindow A Q3DockWindow. \value CT_HeaderSection A header section, like QHeader. \value CT_LineEdit A line edit, like QLineEdit. \value CT_Menu A menu, like QMenu. - \value CT_Q3Header A Qt 3 header section, like Q3Header. \value CT_MenuBar A menu bar, like QMenuBar. \value CT_MenuBarItem A menu bar item, like the buttons in a QMenuBar. \value CT_MenuItem A menu item, like QMenuItem. @@ -1575,7 +1532,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \row \li \l CT_ToolButton \li \l QStyleOptionToolButton \row \li \l CT_ComboBox \li \l QStyleOptionComboBox \row \li \l CT_Splitter \li \l QStyleOption - \row \li \l CT_Q3DockWindow \li \l QStyleOptionQ3DockWindow \row \li \l CT_ProgressBar \li \l QStyleOptionProgressBar \row \li \l CT_MenuItem \li \l QStyleOptionMenuItem \endtable @@ -1712,7 +1668,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value SH_TabBar_SelectMouseType Which type of mouse event should cause a tab to be selected. - \value SH_Q3ListViewExpand_SelectMouseType Which type of mouse event should + \value SH_ListViewExpand_SelectMouseType Which type of mouse event should cause a list view expansion to be selected. \value SH_TabBar_PreferNoArrows Whether a tab bar should suggest a size diff --git a/src/widgets/styles/qstyle.h b/src/widgets/styles/qstyle.h index a8ec8c8c3e..985e7a88aa 100644 --- a/src/widgets/styles/qstyle.h +++ b/src/widgets/styles/qstyle.h @@ -136,12 +136,6 @@ public: enum PrimitiveElement { - PE_Q3CheckListController, - PE_Q3CheckListExclusiveIndicator, - PE_Q3CheckListIndicator, - PE_Q3DockWindowSeparator, - PE_Q3Separator, - PE_Frame, PE_FrameDefaultButton, PE_FrameDockWidget, @@ -243,7 +237,6 @@ public: CE_HeaderSection, CE_HeaderLabel, - CE_Q3DockWindowEmptyArea, CE_ToolBoxTab, CE_SizeGrip, CE_Splitter, @@ -297,23 +290,10 @@ public: SE_SliderFocusRect, - SE_Q3DockWindowHandleRect, - SE_ProgressBarGroove, SE_ProgressBarContents, SE_ProgressBarLabel, - // ### Qt 5: These values are unused; eliminate them - SE_DialogButtonAccept, - SE_DialogButtonReject, - SE_DialogButtonApply, - SE_DialogButtonHelp, - SE_DialogButtonAll, - SE_DialogButtonAbort, - SE_DialogButtonIgnore, - SE_DialogButtonRetry, - SE_DialogButtonCustom, - SE_ToolBoxTabContents, SE_HeaderLabel, @@ -383,7 +363,6 @@ public: CC_Slider, CC_ToolButton, CC_TitleBar, - CC_Q3ListView, CC_Dial, CC_GroupBox, CC_MdiControls, @@ -431,10 +410,6 @@ public: SC_TitleBarContextHelpButton = 0x00000080, SC_TitleBarLabel = 0x00000100, - SC_Q3ListView = 0x00000001, - SC_Q3ListViewBranch = 0x00000002, - SC_Q3ListViewExpand = 0x00000004, - SC_DialGroove = 0x00000001, SC_DialHandle = 0x00000002, SC_DialTickmarks = 0x00000004, @@ -514,8 +489,6 @@ public: PM_IndicatorHeight, PM_ExclusiveIndicatorWidth, PM_ExclusiveIndicatorHeight, - PM_CheckListButtonSize, - PM_CheckListControllerSize, PM_DialogButtonsSeparator, PM_DialogButtonsButtonWidth, @@ -596,7 +569,6 @@ public: CT_ToolButton, CT_ComboBox, CT_Splitter, - CT_Q3DockWindow, CT_ProgressBar, CT_MenuItem, CT_MenuBarItem, @@ -605,7 +577,6 @@ public: CT_TabBarTab, CT_Slider, CT_ScrollBar, - CT_Q3Header, CT_LineEdit, CT_SpinBox, CT_SizeGrip, @@ -669,7 +640,7 @@ public: SH_ToolBox_SelectedPageTitleBold, SH_TabBar_PreferNoArrows, SH_ScrollBar_LeftClickAbsolutePosition, - SH_Q3ListViewExpand_SelectMouseType, + SH_ListViewExpand_SelectMouseType, SH_UnderlineShortcut, SH_SpinBox_AnimateButton, SH_SpinBox_KeyPressAutoRepeatRate, diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp index d72ba1bac5..0b0c6e2393 100644 --- a/src/widgets/styles/qstyleoption.cpp +++ b/src/widgets/styles/qstyleoption.cpp @@ -136,12 +136,6 @@ QT_BEGIN_NAMESPACE \value SO_ComplexCustomBase Reserved for custom QStyleOptions; all custom complex controls values must be above this value - Some style options are defined for various Qt3Support controls: - - \value SO_Q3DockWindow \l QStyleOptionQ3DockWindow - \value SO_Q3ListView \l QStyleOptionQ3ListView - \value SO_Q3ListViewItem \l QStyleOptionQ3ListViewItem - \sa type */ @@ -2233,382 +2227,6 @@ QStyleOptionSpinBox::QStyleOptionSpinBox(int version) #endif // QT_NO_SPINBOX /*! - \class QStyleOptionQ3ListViewItem - \brief The QStyleOptionQ3ListViewItem class is used to describe an - item drawn in a Q3ListView. - - \inmodule QtWidgets - - This class is used for drawing the compatibility Q3ListView's - items. \b {It is not recommended for new classes}. - - QStyleOptionQ3ListViewItem contains all the information that - QStyle functions need to draw the Q3ListView items. - - For performance reasons, the access to the member variables is - direct (i.e., using the \c . or \c -> operator). This low-level feel - makes the structures straightforward to use and emphasizes that - these are simply parameters used by the style functions. - - For an example demonstrating how style options can be used, see - the \l {widgets/styles}{Styles} example. - - \sa QStyleOption, QStyleOptionQ3ListView, Q3ListViewItem -*/ - -/*! - \enum QStyleOptionQ3ListViewItem::Q3ListViewItemFeature - - This enum describes the features a list view item can have. - - \value None A standard item. - \value Expandable The item has children that can be shown. - \value MultiLine The item is more than one line tall. - \value Visible The item is visible. - \value ParentControl The item's parent is a type of item control (Q3CheckListItem::Controller). - - \sa features, Q3ListViewItem::isVisible(), Q3ListViewItem::multiLinesEnabled(), - Q3ListViewItem::isExpandable() -*/ - -/*! - Constructs a QStyleOptionQ3ListViewItem, initializing the members - variables to their default values. -*/ - -QStyleOptionQ3ListViewItem::QStyleOptionQ3ListViewItem() - : QStyleOption(Version, SO_Q3ListViewItem), features(None), height(0), totalHeight(0), - itemY(0), childCount(0) -{ -} - -/*! - \internal -*/ -QStyleOptionQ3ListViewItem::QStyleOptionQ3ListViewItem(int version) - : QStyleOption(version, SO_Q3ListViewItem), features(None), height(0), totalHeight(0), - itemY(0), childCount(0) -{ -} - -/*! - \fn QStyleOptionQ3ListViewItem::QStyleOptionQ3ListViewItem(const QStyleOptionQ3ListViewItem &other) - - Constructs a copy of the \a other style option. -*/ - -/*! - \enum QStyleOptionQ3ListViewItem::StyleOptionType - - This enum is used to hold information about the type of the style option, and - is defined for each QStyleOption subclass. - - \value Type The type of style option provided (\l{SO_Q3ListViewItem} for this class). - - The type is used internally by QStyleOption, its subclasses, and - qstyleoption_cast() to determine the type of style option. In - general you do not need to worry about this unless you want to - create your own QStyleOption subclass and your own styles. - - \sa StyleOptionVersion -*/ - -/*! - \enum QStyleOptionQ3ListViewItem::StyleOptionVersion - - This enum is used to hold information about the version of the style option, and - is defined for each QStyleOption subclass. - - \value Version 1 - - The version is used by QStyleOption subclasses to implement - extensions without breaking compatibility. If you use - qstyleoption_cast(), you normally do not need to check it. - - \sa StyleOptionType -*/ - -/*! - \variable QStyleOptionQ3ListViewItem::features - \brief the features for this item - - This variable is a bitwise OR of the features of the item. The deafult value is \l None. - - \sa Q3ListViewItemFeature -*/ - -/*! - \variable QStyleOptionQ3ListViewItem::height - \brief the height of the item - - This doesn't include the height of the item's children. The default height is 0. - - \sa Q3ListViewItem::height() -*/ - -/*! - \variable QStyleOptionQ3ListViewItem::totalHeight - \brief the total height of the item, including its children - - The default total height is 0. - - \sa Q3ListViewItem::totalHeight() -*/ - -/*! - \variable QStyleOptionQ3ListViewItem::itemY - \brief the Y-coordinate for the item - - The default value is 0. - - \sa Q3ListViewItem::itemPos() -*/ - -/*! - \variable QStyleOptionQ3ListViewItem::childCount - \brief the number of children the item has -*/ - -/*! - \class QStyleOptionQ3ListView - \brief The QStyleOptionQ3ListView class is used to describe the - parameters for drawing a Q3ListView. - - \inmodule QtWidgets - - This class is used for drawing the compatibility Q3ListView. \b - {It is not recommended for new classes}. - - QStyleOptionQ3ListView contains all the information that QStyle - functions need to draw Q3ListView. - - For performance reasons, the access to the member variables is - direct (i.e., using the \c . or \c -> operator). This low-level feel - makes the structures straightforward to use and emphasizes that - these are simply parameters used by the style functions. - - For an example demonstrating how style options can be used, see - the \l {widgets/styles}{Styles} example. - - \sa QStyleOptionComplex, Q3ListView, QStyleOptionQ3ListViewItem -*/ - -/*! - Creates a QStyleOptionQ3ListView, initializing the members - variables to their default values. -*/ - -QStyleOptionQ3ListView::QStyleOptionQ3ListView() - : QStyleOptionComplex(Version, SO_Q3ListView), viewportBGRole(QPalette::Base), - sortColumn(0), itemMargin(0), treeStepSize(0), rootIsDecorated(false) -{ -} - -/*! - \internal -*/ -QStyleOptionQ3ListView::QStyleOptionQ3ListView(int version) - : QStyleOptionComplex(version, SO_Q3ListView), viewportBGRole(QPalette::Base), - sortColumn(0), itemMargin(0), treeStepSize(0), rootIsDecorated(false) -{ -} - -/*! - \fn QStyleOptionQ3ListView::QStyleOptionQ3ListView(const QStyleOptionQ3ListView &other) - - Constructs a copy of the \a other style option. -*/ - -/*! - \enum QStyleOptionQ3ListView::StyleOptionType - - This enum is used to hold information about the type of the style option, and - is defined for each QStyleOption subclass. - - \value Type The type of style option provided (\l{SO_Q3ListView} for this class). - - The type is used internally by QStyleOption, its subclasses, and - qstyleoption_cast() to determine the type of style option. In - general you do not need to worry about this unless you want to - create your own QStyleOption subclass and your own styles. - - \sa StyleOptionVersion -*/ - -/*! - \enum QStyleOptionQ3ListView::StyleOptionVersion - - This enum is used to hold information about the version of the style option, and - is defined for each QStyleOption subclass. - - \value Version 1 - - The version is used by QStyleOption subclasses to implement - extensions without breaking compatibility. If you use - qstyleoption_cast(), you normally do not need to check it. - - \sa StyleOptionType -*/ - -/*! - \variable QStyleOptionQ3ListView::items - \brief a list of items in the Q3ListView - - This is a list of \l {QStyleOptionQ3ListViewItem}s. The first item - can be used for most of the calculation that are needed for - drawing a list view. Any additional items are the children of - this first item, which may be used for additional information. - - \sa QStyleOptionQ3ListViewItem -*/ - -/*! - \variable QStyleOptionQ3ListView::viewportPalette - \brief the palette of Q3ListView's viewport - - By default, the application's default palette is used. -*/ - -/*! - \variable QStyleOptionQ3ListView::viewportBGRole - \brief the background role of Q3ListView's viewport - - The default value is QPalette::Base. - - \sa QWidget::backgroundRole() -*/ - -/*! - \variable QStyleOptionQ3ListView::sortColumn - \brief the sort column of the list view - - The default value is 0. - - \sa Q3ListView::sortColumn() -*/ - -/*! - \variable QStyleOptionQ3ListView::itemMargin - \brief the margin for items in the list view - - The default value is 0. - - \sa Q3ListView::itemMargin() -*/ - -/*! - \variable QStyleOptionQ3ListView::treeStepSize - \brief the number of pixel to offset children items from their - parents - - The default value is 0. - - \sa Q3ListView::treeStepSize() -*/ - -/*! - \variable QStyleOptionQ3ListView::rootIsDecorated - \brief whether root items are decorated - - The default value is false. - - \sa Q3ListView::rootIsDecorated() -*/ - -/*! - \class QStyleOptionQ3DockWindow - \brief The QStyleOptionQ3DockWindow class is used to describe the - parameters for drawing various parts of a Q3DockWindow. - - \inmodule QtWidgets - - This class is used for drawing the old Q3DockWindow and its - parts. \b {It is not recommended for new classes}. - - QStyleOptionQ3DockWindow contains all the information that QStyle - functions need to draw Q3DockWindow and its parts. - - For performance reasons, the access to the member variables is - direct (i.e., using the \c . or \c -> operator). This low-level feel - makes the structures straightforward to use and emphasizes that - these are simply parameters used by the style functions. - - For an example demonstrating how style options can be used, see - the \l {widgets/styles}{Styles} example. - - \sa QStyleOption, Q3DockWindow -*/ - -/*! - Constructs a QStyleOptionQ3DockWindow, initializing the member - variables to their default values. -*/ - -QStyleOptionQ3DockWindow::QStyleOptionQ3DockWindow() - : QStyleOption(Version, SO_Q3DockWindow), docked(false), closeEnabled(false) -{ -} - -/*! - \internal -*/ -QStyleOptionQ3DockWindow::QStyleOptionQ3DockWindow(int version) - : QStyleOption(version, SO_Q3DockWindow), docked(false), closeEnabled(false) -{ -} - -/*! - \fn QStyleOptionQ3DockWindow::QStyleOptionQ3DockWindow(const QStyleOptionQ3DockWindow &other) - - Constructs a copy of the \a other style option. -*/ - -/*! - \enum QStyleOptionQ3DockWindow::StyleOptionType - - This enum is used to hold information about the type of the style option, and - is defined for each QStyleOption subclass. - - \value Type The type of style option provided (\l{SO_Q3DockWindow} for this class). - - The type is used internally by QStyleOption, its subclasses, and - qstyleoption_cast() to determine the type of style option. In - general you do not need to worry about this unless you want to - create your own QStyleOption subclass and your own styles. - - \sa StyleOptionVersion -*/ - -/*! - \enum QStyleOptionQ3DockWindow::StyleOptionVersion - - This enum is used to hold information about the version of the style option, and - is defined for each QStyleOption subclass. - - \value Version 1 - - The version is used by QStyleOption subclasses to implement - extensions without breaking compatibility. If you use - qstyleoption_cast(), you normally do not need to check it. - - \sa StyleOptionType -*/ - -/*! - \variable QStyleOptionQ3DockWindow::docked - \brief whether the dock window is currently docked - - The default value is false. -*/ - -/*! - \variable QStyleOptionQ3DockWindow::closeEnabled - \brief whether the dock window has a close button - - The default value is false. -*/ - -/*! \class QStyleOptionDockWidget \brief The QStyleOptionDockWidget class is used to describe the parameters for drawing a dock widget. @@ -4376,12 +3994,8 @@ QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType) debug << "SO_ToolBox"; break; case QStyleOption::SO_Header: debug << "SO_Header"; break; - case QStyleOption::SO_Q3DockWindow: - debug << "SO_Q3DockWindow"; break; case QStyleOption::SO_DockWidget: debug << "SO_DockWidget"; break; - case QStyleOption::SO_Q3ListViewItem: - debug << "SO_Q3ListViewItem"; break; case QStyleOption::SO_ViewItem: debug << "SO_ViewItem"; break; case QStyleOption::SO_TabWidgetFrame: @@ -4400,8 +4014,6 @@ QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType) debug << "SO_ToolButton"; break; case QStyleOption::SO_ComboBox: debug << "SO_ComboBox"; break; - case QStyleOption::SO_Q3ListView: - debug << "SO_Q3ListView"; break; case QStyleOption::SO_TitleBar: debug << "SO_TitleBar"; break; case QStyleOption::SO_CustomBase: diff --git a/src/widgets/styles/qstyleoption.h b/src/widgets/styles/qstyleoption.h index 677a48ec20..588898637f 100644 --- a/src/widgets/styles/qstyleoption.h +++ b/src/widgets/styles/qstyleoption.h @@ -68,12 +68,12 @@ class Q_WIDGETS_EXPORT QStyleOption public: enum OptionType { SO_Default, SO_FocusRect, SO_Button, SO_Tab, SO_MenuItem, - SO_Frame, SO_ProgressBar, SO_ToolBox, SO_Header, SO_Q3DockWindow, - SO_DockWidget, SO_Q3ListViewItem, SO_ViewItem, SO_TabWidgetFrame, + SO_Frame, SO_ProgressBar, SO_ToolBox, SO_Header, + SO_DockWidget, SO_ViewItem, SO_TabWidgetFrame, SO_TabBarBase, SO_RubberBand, SO_ToolBar, SO_GraphicsItem, SO_Complex = 0xf0000, SO_Slider, SO_SpinBox, SO_ToolButton, SO_ComboBox, - SO_Q3ListView, SO_TitleBar, SO_GroupBox, SO_SizeGrip, + SO_TitleBar, SO_GroupBox, SO_SizeGrip, SO_CustomBase = 0xf00, SO_ComplexCustomBase = 0xf000000 @@ -363,47 +363,6 @@ protected: QStyleOptionMenuItem(int version); }; -class Q_WIDGETS_EXPORT QStyleOptionQ3ListViewItem : public QStyleOption -{ -public: - enum StyleOptionType { Type = SO_Q3ListViewItem }; - enum StyleOptionVersion { Version = 1 }; - - enum Q3ListViewItemFeature { None = 0x00, Expandable = 0x01, MultiLine = 0x02, Visible = 0x04, - ParentControl = 0x08 }; - Q_DECLARE_FLAGS(Q3ListViewItemFeatures, Q3ListViewItemFeature) - - Q3ListViewItemFeatures features; - int height; - int totalHeight; - int itemY; - int childCount; - - QStyleOptionQ3ListViewItem(); - QStyleOptionQ3ListViewItem(const QStyleOptionQ3ListViewItem &other) : QStyleOption(Version, Type) { *this = other; } - -protected: - QStyleOptionQ3ListViewItem(int version); -}; - -Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionQ3ListViewItem::Q3ListViewItemFeatures) - -class Q_WIDGETS_EXPORT QStyleOptionQ3DockWindow : public QStyleOption -{ -public: - enum StyleOptionType { Type = SO_Q3DockWindow }; - enum StyleOptionVersion { Version = 1 }; - - bool docked; - bool closeEnabled; - - QStyleOptionQ3DockWindow(); - QStyleOptionQ3DockWindow(const QStyleOptionQ3DockWindow &other) : QStyleOption(Version, Type) { *this = other; } - -protected: - QStyleOptionQ3DockWindow(int version); -}; - class Q_WIDGETS_EXPORT QStyleOptionDockWidget : public QStyleOption { public: @@ -585,27 +544,6 @@ protected: }; #endif // QT_NO_SPINBOX -class Q_WIDGETS_EXPORT QStyleOptionQ3ListView : public QStyleOptionComplex -{ -public: - enum StyleOptionType { Type = SO_Q3ListView }; - enum StyleOptionVersion { Version = 1 }; - - QList<QStyleOptionQ3ListViewItem> items; - QPalette viewportPalette; - QPalette::ColorRole viewportBGRole; - int sortColumn; - int itemMargin; - int treeStepSize; - bool rootIsDecorated; - - QStyleOptionQ3ListView(); - QStyleOptionQ3ListView(const QStyleOptionQ3ListView &other) : QStyleOptionComplex(Version, Type) { *this = other; } - -protected: - QStyleOptionQ3ListView(int version); -}; - class Q_WIDGETS_EXPORT QStyleOptionToolButton : public QStyleOptionComplex { public: diff --git a/src/widgets/styles/qwindowscestyle.cpp b/src/widgets/styles/qwindowscestyle.cpp index 5bd2de290a..49d4e74aaf 100644 --- a/src/widgets/styles/qwindowscestyle.cpp +++ b/src/widgets/styles/qwindowscestyle.cpp @@ -264,14 +264,13 @@ void QWindowsCEStyle::drawPrimitive(PrimitiveElement element, const QStyleOption option->rect.x() + 1, option->rect.y() + option->rect.height() - 1); //fall through... } - case PE_IndicatorViewItemCheck: - case PE_Q3CheckListIndicator: { + case PE_IndicatorViewItemCheck: { if (!doRestore) { painter->save(); doRestore = true; } int arrowSize= 2; - if (element == PE_Q3CheckListIndicator || element == PE_IndicatorViewItemCheck) { + if (element == PE_IndicatorViewItemCheck) { QLinearGradient linearGradient(QPoint(option->rect.x(),option->rect.y()), QPoint(option->rect.x()+option->rect.width(), option->rect.y()+option->rect.height())); linearGradient.setColorAt(0, windowsCECheckBoxGradientColorBegin); diff --git a/src/widgets/styles/qwindowsmobilestyle.cpp b/src/widgets/styles/qwindowsmobilestyle.cpp index 30269751ca..863bd1aa62 100644 --- a/src/widgets/styles/qwindowsmobilestyle.cpp +++ b/src/widgets/styles/qwindowsmobilestyle.cpp @@ -4875,13 +4875,12 @@ void QWindowsMobileStyle::drawPrimitive(PrimitiveElement element, const QStyleOp } //fall through... } - case PE_IndicatorViewItemCheck: - case PE_Q3CheckListIndicator: { + case PE_IndicatorViewItemCheck: { if (!doRestore) { painter->save(); doRestore = true; } - if (element == PE_Q3CheckListIndicator || element == PE_IndicatorViewItemCheck) { + if (element == PE_IndicatorViewItemCheck) { painter->setPen(option->palette.shadow().color()); if (option->state & State_NoChange) painter->setBrush(option->palette.brush(QPalette::Button)); diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index 1cd53c8073..97721da297 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -1461,12 +1461,11 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, p->setPen(opt->palette.text().color()); } // Fall through! case PE_IndicatorViewItemCheck: - case PE_Q3CheckListIndicator: if (!doRestore) { p->save(); doRestore = true; } - if (pe == PE_Q3CheckListIndicator || pe == PE_IndicatorViewItemCheck) { + if (pe == PE_IndicatorViewItemCheck) { const QStyleOptionViewItem *itemViewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt); p->setPen(itemViewOpt && itemViewOpt->showDecorationSelected diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp index 336d93e8c1..c911670442 100644 --- a/src/widgets/styles/qwindowsxpstyle.cpp +++ b/src/widgets/styles/qwindowsxpstyle.cpp @@ -1208,9 +1208,9 @@ void QWindowsXPStyle::polish(QWidget *widget) || qobject_cast<QAbstractSpinBox*>(widget) || qobject_cast<QSpinBox*>(widget) #endif // QT_NO_SPINBOX - || widget->inherits("QWorkspaceChild") - || widget->inherits("Q3TitleBar")) + ) { widget->setAttribute(Qt::WA_Hover); + } #ifndef QT_NO_RUBBERBAND if (qobject_cast<QRubberBand*>(widget)) { @@ -1280,9 +1280,9 @@ void QWindowsXPStyle::unpolish(QWidget *widget) || qobject_cast<QAbstractSpinBox*>(widget) || qobject_cast<QSpinBox*>(widget) #endif // QT_NO_SPINBOX - || widget->inherits("QWorkspaceChild") - || widget->inherits("Q3TitleBar")) + ) { widget->setAttribute(Qt::WA_Hover, false); + } QWindowsStyle::unpolish(widget); } @@ -1852,14 +1852,6 @@ case PE_Frame: } break; - case PE_Q3DockWindowSeparator: - themeNumber = QWindowsXPStylePrivate::ToolBarTheme; - if (flags & State_Horizontal) - partId = TP_SEPARATOR; - else - partId = TP_SEPARATORVERT; - break; - case PE_FrameWindow: if (const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(option)) { @@ -3268,63 +3260,6 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo } break; -#ifndef QT_NO_WORKSPACE - case CC_MdiControls: - { - QRect buttonRect; - XPThemeData theme(widget, p, QWindowsXPStylePrivate::WindowTheme, WP_MDICLOSEBUTTON, CBS_NORMAL); - - if (option->subControls & SC_MdiCloseButton) { - buttonRect = proxy()->subControlRect(CC_MdiControls, option, SC_MdiCloseButton, widget); - if (theme.isValid()) { - theme.partId = WP_MDICLOSEBUTTON; - theme.rect = buttonRect; - if (!(flags & State_Enabled)) - theme.stateId = CBS_INACTIVE; - else if (flags & State_Sunken && (option->activeSubControls & SC_MdiCloseButton)) - theme.stateId = CBS_PUSHED; - else if (flags & State_MouseOver && (option->activeSubControls & SC_MdiCloseButton)) - theme.stateId = CBS_HOT; - else - theme.stateId = CBS_NORMAL; - d->drawBackground(theme); - } - } - if (option->subControls & SC_MdiNormalButton) { - buttonRect = proxy()->subControlRect(CC_MdiControls, option, SC_MdiNormalButton, widget); - if (theme.isValid()) { - theme.partId = WP_MDIRESTOREBUTTON; - theme.rect = buttonRect; - if (!(flags & State_Enabled)) - theme.stateId = CBS_INACTIVE; - else if (flags & State_Sunken && (option->activeSubControls & SC_MdiNormalButton)) - theme.stateId = CBS_PUSHED; - else if (flags & State_MouseOver && (option->activeSubControls & SC_MdiNormalButton)) - theme.stateId = CBS_HOT; - else - theme.stateId = CBS_NORMAL; - d->drawBackground(theme); - } - } - if (option->subControls & QStyle::SC_MdiMinButton) { - buttonRect = proxy()->subControlRect(CC_MdiControls, option, SC_MdiMinButton, widget); - if (theme.isValid()) { - theme.partId = WP_MDIMINBUTTON; - theme.rect = buttonRect; - if (!(flags & State_Enabled)) - theme.stateId = CBS_INACTIVE; - else if (flags & State_Sunken && (option->activeSubControls & SC_MdiMinButton)) - theme.stateId = CBS_PUSHED; - else if (flags & State_MouseOver && (option->activeSubControls & SC_MdiMinButton)) - theme.stateId = CBS_HOT; - else - theme.stateId = CBS_NORMAL; - d->drawBackground(theme); - } - } - } - break; -#endif //QT_NO_WORKSPACE #ifndef QT_NO_DIAL case CC_Dial: if (const QStyleOptionSlider *dial = qstyleoption_cast<const QStyleOptionSlider *>(option)) @@ -3712,44 +3647,6 @@ QRect QWindowsXPStyle::subControlRect(ComplexControl cc, const QStyleOptionCompl } } break; -#ifndef QT_NO_WORKSPACE - case CC_MdiControls: - { - int numSubControls = 0; - if (option->subControls & SC_MdiCloseButton) - ++numSubControls; - if (option->subControls & SC_MdiMinButton) - ++numSubControls; - if (option->subControls & SC_MdiNormalButton) - ++numSubControls; - if (numSubControls == 0) - break; - - int buttonWidth = option->rect.width()/ numSubControls; - int offset = 0; - switch (subControl) { - case SC_MdiCloseButton: - // Only one sub control, no offset needed. - if (numSubControls == 1) - break; - offset += buttonWidth; - //FALL THROUGH - case SC_MdiNormalButton: - // No offset needed if - // 1) There's only one sub control - // 2) We have a close button and a normal button (offset already added in SC_MdiClose) - if (numSubControls == 1 || (numSubControls == 2 && !(option->subControls & SC_MdiMinButton))) - break; - if (option->subControls & SC_MdiNormalButton) - offset += buttonWidth; - break; - default: - break; - } - rect = QRect(offset, 0, buttonWidth, option->rect.height()); - break; - } -#endif // QT_NO_WORKSPACE default: rect = visualRect(option->direction, option->rect, |