summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qcleanlooksstyle.cpp17
-rw-r--r--src/widgets/styles/qcommonstyle.cpp152
-rw-r--r--src/widgets/styles/qmacstyle_mac.h3
-rw-r--r--src/widgets/styles/qmotifstyle.cpp5
-rw-r--r--src/widgets/styles/qplastiquestyle.cpp96
-rw-r--r--src/widgets/styles/qstyle.h16
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp6
-rw-r--r--src/widgets/styles/qwindowsstyle.cpp165
-rw-r--r--src/widgets/styles/qwindowsxpstyle.cpp10
9 files changed, 0 insertions, 470 deletions
diff --git a/src/widgets/styles/qcleanlooksstyle.cpp b/src/widgets/styles/qcleanlooksstyle.cpp
index 6da0e9177e..7ddac81be8 100644
--- a/src/widgets/styles/qcleanlooksstyle.cpp
+++ b/src/widgets/styles/qcleanlooksstyle.cpp
@@ -884,12 +884,6 @@ void QCleanlooksStyle::drawPrimitive(PrimitiveElement elem,
case PE_FrameLineEdit:
// fall through
#endif // QT_NO_LINEEDIT
-#ifdef QT3_SUPPORT
- if (widget && widget->inherits("Q3ToolBar")) {
- proxy()->drawPrimitive(PE_Q3Separator, option, painter, widget);
- break;
- }
-#endif
{
QPen oldPen = painter->pen();
if (option->state & State_Enabled) {
@@ -2697,13 +2691,6 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
QColor textColor(active ? 0xffffff : 0xff000000);
QColor textAlphaColor(active ? 0xffffff : 0xff000000 );
-#ifdef QT3_SUPPORT
- if (widget && widget->inherits("Q3DockWindowTitleBar")) {
- QStyleOptionDockWidgetV2 dockwidget;
- dockwidget.QStyleOption::operator=(*option);
- proxy()->drawControl(CE_DockWidgetTitle, &dockwidget, painter, widget);
- } else
-#endif // QT3_SUPPORT
{
// Fill title bar gradient
QColor titlebarColor = QColor(active ? highlight: palette.background().color());
@@ -4324,10 +4311,6 @@ int QCleanlooksStyle::styleHint(StyleHint hint, const QStyleOption *option, cons
break;
}
case SH_ComboBox_Popup:
-#ifdef QT3_SUPPORT
- if (widget && widget->inherits("Q3ComboBox"))
- return 0;
-#endif
if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(option))
ret = !cmb->editable;
else
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 327bedfdba..8dcbb3105d 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -279,116 +279,6 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
}
break;
#endif // QT_NO_PROGRESSBAR
-#ifdef QT3_SUPPORT
- case PE_Q3CheckListController:
-#ifndef QT_NO_IMAGEFORMAT_XPM
- p->drawPixmap(opt->rect.topLeft(), QPixmap(check_list_controller_xpm));
-#endif
- break;
- case PE_Q3CheckListExclusiveIndicator:
- if (const QStyleOptionQ3ListView *lv = qstyleoption_cast<const QStyleOptionQ3ListView *>(opt)) {
- if (lv->items.isEmpty())
- return;
- int x = lv->rect.x(),
- y = lv->rect.y();
-#define INTARRLEN(x) sizeof(x)/(sizeof(int)*2)
- static const int pts1[] = { // dark lines
- 1,9, 1,8, 0,7, 0,4, 1,3, 1,2, 2,1, 3,1, 4,0, 7,0, 8,1, 9,1 };
- static const int pts2[] = { // black lines
- 2,8, 1,7, 1,4, 2,3, 2,2, 3,2, 4,1, 7,1, 8,2, 9,2 };
- static const int pts3[] = { // background lines
- 2,9, 3,9, 4,10, 7,10, 8,9, 9,9, 9,8, 10,7, 10,4, 9,3 };
- static const int pts4[] = { // white lines
- 2,10, 3,10, 4,11, 7,11, 8,10, 9,10, 10,9, 10,8, 11,7,
- 11,4, 10,3, 10,2 };
- // static const int pts5[] = { // inner fill
- // 4,2, 7,2, 9,4, 9,7, 7,9, 4,9, 2,7, 2,4 };
- //QPolygon a;
-
- if (lv->state & State_Enabled)
- p->setPen(lv->palette.text().color());
- else
- p->setPen(QPen(lv->viewportPalette.color(QPalette::Disabled, QPalette::Text)));
- QPolygon a(INTARRLEN(pts1), pts1);
- a.translate(x, y);
- //p->setPen(pal.dark());
- p->drawPolyline(a);
- a.setPoints(INTARRLEN(pts2), pts2);
- a.translate(x, y);
- p->drawPolyline(a);
- a.setPoints(INTARRLEN(pts3), pts3);
- a.translate(x, y);
- // p->setPen(black);
- p->drawPolyline(a);
- a.setPoints(INTARRLEN(pts4), pts4);
- a.translate(x, y);
- // p->setPen(blue);
- p->drawPolyline(a);
- // a.setPoints(INTARRLEN(pts5), pts5);
- // a.translate(x, y);
- // QColor fillColor = isDown() ? g.background() : g.base();
- // p->setPen(fillColor);
- // p->setBrush(fillColor);
- // p->drawPolygon(a);
- if (opt->state & State_On) {
- p->setPen(Qt::NoPen);
- p->setBrush(opt->palette.text());
- p->drawRect(x + 5, y + 4, 2, 4);
- p->drawRect(x + 4, y + 5, 4, 2);
- }
-#undef INTARRLEN
- }
- break;
- case PE_Q3CheckListIndicator:
- if (const QStyleOptionQ3ListView *lv = qstyleoption_cast<const QStyleOptionQ3ListView *>(opt)) {
- if(lv->items.isEmpty())
- break;
- QStyleOptionQ3ListViewItem item = lv->items.at(0);
- int x = lv->rect.x(),
- y = lv->rect.y(),
- w = lv->rect.width(),
- h = lv->rect.width(),
- marg = lv->itemMargin;
-
- if (lv->state & State_Enabled)
- p->setPen(QPen(lv->palette.text().color(), 2));
- else
- p->setPen(QPen(lv->viewportPalette.color(QPalette::Disabled, QPalette::Text), 2));
- if (opt->state & State_Selected && !lv->rootIsDecorated
- && !(item.features & QStyleOptionQ3ListViewItem::ParentControl)) {
- p->fillRect(0, 0, x + marg + w + 4, item.height,
- lv->palette.brush(QPalette::Highlight));
- if (item.state & State_Enabled)
- p->setPen(QPen(lv->palette.highlightedText().color(), 2));
- }
-
- if (lv->state & State_NoChange)
- p->setBrush(lv->palette.brush(QPalette::Button));
- p->drawRect(x + marg, y + 2, w - 4, h - 4);
- /////////////////////
- ++x;
- ++y;
- if (lv->state & State_On || lv->state & State_NoChange) {
- QLineF lines[7];
- int i,
- xx = x + 1 + marg,
- yy = y + 5;
- for (i = 0; i < 3; ++i) {
- lines[i] = QLineF(xx, yy, xx, yy + 2);
- ++xx;
- ++yy;
- }
- yy -= 2;
- for (i = 3; i < 7; ++i) {
- lines[i] = QLineF(xx, yy, xx, yy + 2);
- ++xx;
- --yy;
- }
- p->drawLines(lines, 7);
- }
- }
- break;
-#endif // QT3_SUPPORT
case PE_IndicatorBranch: {
int mid_h = opt->rect.x() + opt->rect.width() / 2;
int mid_v = opt->rect.y() + opt->rect.height() / 2;
@@ -420,12 +310,6 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
if (opt->state & (State_Open | State_Children | State_Item | State_Sibling))
p->drawLine(mid_h, opt->rect.y(), mid_h, bef_v);
break; }
-#ifdef QT3_SUPPORT
- case PE_Q3Separator:
- qDrawShadeLine(p, opt->rect.left(), opt->rect.top(), opt->rect.right(), opt->rect.bottom(),
- opt->palette, opt->state & State_Sunken, 1, 0);
- break;
-#endif // QT3_SUPPORT
case PE_FrameStatusBarItem:
qDrawShadeRect(p, opt->rect, opt->palette, true, 1, 0, 0);
break;
@@ -2483,21 +2367,6 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
}
break;
#endif // QT_NO_PROGRESSBAR
-#ifdef QT3_SUPPORT
- case SE_Q3DockWindowHandleRect:
- if (const QStyleOptionQ3DockWindow *dw = qstyleoption_cast<const QStyleOptionQ3DockWindow *>(opt)) {
- if (!dw->docked || !dw->closeEnabled)
- r.setRect(0, 0, dw->rect.width(), dw->rect.height());
- else {
- if (dw->state & State_Horizontal)
- r.setRect(0, 15, dw->rect.width(), dw->rect.height() - 15);
- else
- r.setRect(0, 1, dw->rect.width() - 15, dw->rect.height() - 1);
- }
- r = visualRect(opt->direction, opt->rect, r);
- }
- break;
-#endif // QT3_SUPPORT
#ifndef QT_NO_COMBOBOX
case SE_ComboBoxFocusRect:
if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
@@ -3244,14 +3113,6 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
}
break;
#endif // QT_NO_SCROLLBAR
-#ifdef QT3_SUPPORT
- case CC_Q3ListView:
- if (const QStyleOptionQ3ListView *lv = qstyleoption_cast<const QStyleOptionQ3ListView *>(opt)) {
- if (lv->subControls & SC_Q3ListView)
- p->fillRect(lv->rect, lv->viewportPalette.brush(lv->viewportBGRole));
- }
- break;
-#endif // QT3_SUPPORT
#ifndef QT_NO_SPINBOX
case CC_SpinBox:
if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
@@ -3835,14 +3696,6 @@ QStyle::SubControl QCommonStyle::hitTestComplexControl(ComplexControl cc, const
}
break;
#endif // QT_NO_TOOLBUTTON
-#ifdef QT3_SUPPORT
- case CC_Q3ListView:
- if (const QStyleOptionQ3ListView *lv = qstyleoption_cast<const QStyleOptionQ3ListView *>(opt)) {
- if (pt.x() >= 0 && pt.x() < lv->treeStepSize)
- sc = SC_Q3ListViewExpand;
- }
- break;
-#endif // QT3_SUPPORT
#ifndef QT_NO_SPINBOX
case CC_SpinBox:
if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
@@ -4909,11 +4762,6 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
ret = QEvent::MouseButtonPress;
break;
-#ifdef QT3_SUPPORT
- case SH_GUIStyle:
- ret = Qt::WindowsStyle;
- break;
-#endif
case SH_TabBar_Alignment:
case SH_Header_ArrowAlignment:
diff --git a/src/widgets/styles/qmacstyle_mac.h b/src/widgets/styles/qmacstyle_mac.h
index 44940bd2b7..bb9175cca8 100644
--- a/src/widgets/styles/qmacstyle_mac.h
+++ b/src/widgets/styles/qmacstyle_mac.h
@@ -104,9 +104,6 @@ public:
static FocusRectPolicy focusRectPolicy(const QWidget *w);
enum WidgetSizePolicy { SizeSmall, SizeLarge, SizeMini, SizeDefault
-#ifdef QT3_SUPPORT
- , SizeNone = SizeDefault
-#endif
};
static void setWidgetSizePolicy(const QWidget *w, WidgetSizePolicy policy);
static WidgetSizePolicy widgetSizePolicy(const QWidget *w);
diff --git a/src/widgets/styles/qmotifstyle.cpp b/src/widgets/styles/qmotifstyle.cpp
index d9be3f3643..c24ff4ff59 100644
--- a/src/widgets/styles/qmotifstyle.cpp
+++ b/src/widgets/styles/qmotifstyle.cpp
@@ -2639,11 +2639,6 @@ QMotifStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWidget *w
int ret;
switch (hint) {
-#ifdef QT3_SUPPORT
- case SH_GUIStyle:
- ret = Qt::MotifStyle;
- break;
-#endif
case SH_DrawMenuBarSeparator:
ret = true;
break;
diff --git a/src/widgets/styles/qplastiquestyle.cpp b/src/widgets/styles/qplastiquestyle.cpp
index a5b0235dbe..efff1a5bbe 100644
--- a/src/widgets/styles/qplastiquestyle.cpp
+++ b/src/widgets/styles/qplastiquestyle.cpp
@@ -1413,41 +1413,9 @@ void QPlastiqueStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
painter->setPen(oldPen);
break;
}
-#ifdef QT3_SUPPORT
- case PE_Q3DockWindowSeparator: {
- QPen oldPen = painter->pen();
- painter->setPen(alphaCornerColor);
- QRect rect = option->rect;
- if (option->state & State_Horizontal) {
- painter->drawLine(rect.right(), rect.top() + 2, rect.right(), rect.bottom() - 1);
- } else {
- painter->drawLine(rect.left() + 2, rect.bottom(), rect.right() - 1, rect.bottom());
- }
- painter->setPen(oldPen);
- break;
- }
- case PE_Q3Separator: {
- QPen oldPen = painter->pen();
- painter->setPen(alphaCornerColor);
- if ((option->state & State_Horizontal) == 0)
- painter->drawLine(option->rect.bottomLeft(), option->rect.bottomRight());
- else
- painter->drawLine(option->rect.topRight(), option->rect.bottomRight());
- painter->setPen(option->palette.background().color().lighter(104));
- if ((option->state & State_Horizontal) == 0)
- painter->drawLine(option->rect.topLeft(), option->rect.topRight());
- else
- painter->drawLine(option->rect.topLeft(), option->rect.bottomLeft());
- painter->setPen(oldPen);
- break;
- }
-#endif // QT3_SUPPORT
#ifndef QT_NO_MAINWINDOW
case PE_PanelMenuBar:
if ((widget && qobject_cast<const QMainWindow *>(widget->parentWidget()))
-#ifdef QT3_SUPPORT
- || (widget && widget->parentWidget() && widget->parentWidget()->inherits("Q3MainWindow"))
-#endif
) {
// Draws the light line above and the dark line below menu bars and
// tool bars.
@@ -1489,12 +1457,6 @@ void QPlastiqueStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
case PE_IndicatorToolBarHandle: {
QPixmap cache;
QRect rect = option->rect;
-#ifdef QT3_SUPPORT
- if (widget && widget->inherits("Q3DockWindowHandle") && widget->parentWidget()->inherits("Q3DockWindow")) {
- if (!(option->state & State_Horizontal))
- rect.adjust(2, 0, -2, 0);
- }
-#endif
QString pixmapName = QStyleHelper::uniqueName(QLatin1String("toolbarhandle"), option, rect.size());
if (!QPixmapCache::find(pixmapName, cache)) {
cache = QPixmap(rect.size());
@@ -1865,18 +1827,6 @@ void QPlastiqueStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
points[1] = QPoint(option->rect.right() - 1, option->rect.bottom() - 1);
painter->drawPoints(points, 2);
-#ifdef QT3_SUPPORT
- if (widget && widget->inherits("Q3DockWindow")) {
- // also draw the frame on the title bar
- lines[0] = QLine(option->rect.left() + 1, option->rect.top(),
- option->rect.right() - 1, option->rect.top());
- lines[1] = QLine(option->rect.left(), option->rect.top() + 1,
- option->rect.left(), titleBarStop);
- lines[2] = QLine(option->rect.right(), option->rect.top() + 1,
- option->rect.right(), titleBarStop);
- painter->drawLines(lines, 3);
- }
-#endif
// alpha corners
painter->setPen(mergedColors(palette.highlight().color(), palette.background().color(), 55));
@@ -1886,31 +1836,11 @@ void QPlastiqueStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
points[3] = QPoint(option->rect.right() - 1, option->rect.bottom() - 2);
painter->drawPoints(points, 4);
-#ifdef QT3_SUPPORT
- if (widget && widget->inherits("Q3DockWindow")) {
- // also draw the frame on the title bar
- points[0] = option->rect.topLeft();
- points[1] = option->rect.topRight();
- painter->drawPoints(points, 2);
- }
-#endif
// upper and lower left inner
painter->setPen(active ? mergedColors(palette.highlight().color(), palette.background().color()) : palette.background().color().darker(120));
painter->drawLine(option->rect.left() + 1, titleBarStop, option->rect.left() + 1, option->rect.bottom() - 2);
-#ifdef QT3_SUPPORT
- if (widget && widget->inherits("Q3DockWindow")) {
- // also draw the frame on the title bar
- lines[0] = QLine(option->rect.left() + 1, option->rect.top() + 1,
- option->rect.left() + 1, titleBarStop);
- lines[1] = QLine(option->rect.right() - 1, option->rect.top() + 1,
- option->rect.right() - 1, titleBarStop);
- lines[2] = QLine(option->rect.left() + 1, option->rect.top() + 1,
- option->rect.right() - 1, option->rect.top() + 1);
- painter->drawLines(lines, 3);
- }
-#endif
painter->setPen(active ? mergedColors(palette.highlight().color(), palette.background().color(), 57) : palette.background().color().darker(130));
lines[0] = QLine(option->rect.right() - 1, titleBarStop, option->rect.right() - 1, option->rect.bottom() - 2);
@@ -3260,12 +3190,6 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op
if (title.isEmpty()) {
// Joint handle if there's no title
QRect r;
-#ifdef QT3_SUPPORT
- // Q3DockWindow doesn't need space for buttons
- if (widget && widget->inherits("Q3DockWindowTitleBar")) {
- r = rect;
- } else
-#endif
r.setRect(titleRect.left(), titleRect.top(), titleRect.width(), titleRect.bottom());
int nchunks = (r.width() / handle.width()) - 1;
int indent = (r.width() - (nchunks * handle.width())) / 2;
@@ -4573,14 +4497,6 @@ void QPlastiqueStyle::drawComplexControl(ComplexControl control, const QStyleOpt
QColor textColor(active ? 0x282e40 : 0x282e40);
QColor textAlphaColor(active ? 0x3f4862 : 0x3f4862);
-#ifdef QT3_SUPPORT
- if (widget && widget->inherits("Q3DockWindowTitleBar")) {
- QStyleOptionDockWidgetV2 dockwidget;
- dockwidget.QStyleOption::operator=(*option);
- dockwidget.title = titleBar->text;
- proxy()->drawControl(CE_DockWidgetTitle, &dockwidget, painter, widget);
- } else
-#endif // QT3_SUPPORT
{
// Fill title bar gradient
@@ -5588,12 +5504,6 @@ int QPlastiqueStyle::pixelMetric(PixelMetric metric, const QStyleOption *option,
ret = 4;
break;
case PM_TitleBarHeight:
-#ifdef QT3_SUPPORT
- if (widget && widget->inherits("Q3DockWindowTitleBar")) {
- // Q3DockWindow has smaller title bars than QDockWidget
- ret = qMax(widget->fontMetrics().height(), 20);
- } else
-#endif
ret = qMax(widget ? widget->fontMetrics().height() :
(option ? option->fontMetrics.height() : 0), 30);
break;
@@ -5728,9 +5638,6 @@ void QPlastiqueStyle::polish(QWidget *widget)
#ifndef QT_NO_MENUBAR
|| qobject_cast<QMenuBar *>(widget)
#endif
-#ifdef QT3_SUPPORT
- || widget->inherits("Q3ToolBar")
-#endif
#ifndef QT_NO_TOOLBAR
|| qobject_cast<QToolBar *>(widget)
|| (widget && qobject_cast<QToolBar *>(widget->parent()))
@@ -5790,9 +5697,6 @@ void QPlastiqueStyle::unpolish(QWidget *widget)
#ifndef QT_NO_TOOLBOX
|| qobject_cast<QToolBox *>(widget)
#endif
-#ifdef QT3_SUPPORT
- || widget->inherits("Q3ToolBar")
-#endif
#ifndef QT_NO_TOOLBAR
|| qobject_cast<QToolBar *>(widget)
|| (widget && qobject_cast<QToolBar *>(widget->parent()))
diff --git a/src/widgets/styles/qstyle.h b/src/widgets/styles/qstyle.h
index 1896f129e1..6b296871d4 100644
--- a/src/widgets/styles/qstyle.h
+++ b/src/widgets/styles/qstyle.h
@@ -102,9 +102,6 @@ public:
enum StateFlag {
State_None = 0x00000000,
-#ifdef QT3_SUPPORT
- State_Default = State_None,
-#endif
State_Enabled = 0x00000001,
State_Raised = 0x00000002,
State_Sunken = 0x00000004,
@@ -138,9 +135,6 @@ public:
};
Q_DECLARE_FLAGS(State, StateFlag)
-#ifdef QT3_SUPPORT
- typedef State SFlags;
-#endif
enum PrimitiveElement {
PE_Q3CheckListController,
@@ -460,9 +454,6 @@ public:
};
Q_DECLARE_FLAGS(SubControls, SubControl)
-#ifdef QT3_SUPPORT
- typedef SubControls SCFlags;
-#endif
virtual void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p,
const QWidget *widget = 0) const = 0;
@@ -739,13 +730,6 @@ public:
SH_RequestSoftwareInputPanel,
// Add new style hint values here
-#ifdef QT3_SUPPORT
- SH_GUIStyle = 0x00000100,
- SH_ScrollBar_BackgroundMode,
- // Add other compat values here
-
- SH_UnderlineAccelerator = SH_UnderlineShortcut,
-#endif
SH_CustomBase = 0xf0000000
};
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 357b43c2b4..ab611aedde 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -5816,9 +5816,6 @@ void QStyleSheetStyle::updateStyleSheetFont(QWidget* w) const
if (w->data->fnt == font)
return;
-#ifdef QT3_SUPPORT
- QFont old = w->data->fnt;
-#endif
w->data->fnt = font;
#if defined(Q_WS_X11)
// make sure the font set on this widget is associated with the correct screen
@@ -5827,9 +5824,6 @@ void QStyleSheetStyle::updateStyleSheetFont(QWidget* w) const
QEvent e(QEvent::FontChange);
QApplication::sendEvent(w, &e);
-#ifdef QT3_SUPPORT
- w->fontChange(old);
-#endif
}
void QStyleSheetStyle::saveWidgetFont(QWidget* w, const QFont& font) const
diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp
index d1d3865868..7b2fbd6306 100644
--- a/src/widgets/styles/qwindowsstyle.cpp
+++ b/src/widgets/styles/qwindowsstyle.cpp
@@ -475,12 +475,6 @@ int QWindowsStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, const QW
#if defined(Q_WS_WIN)
case PM_TitleBarHeight:
-#ifdef QT3_SUPPORT
- // qt3 dockwindow height should be equal to tool windows
- if (widget && widget->inherits("Q3DockWindowTitleBar")) {
- ret = GetSystemMetrics(SM_CYSMCAPTION) - 1;
- } else
-#endif
if (widget && (widget->windowType() == Qt::Tool)) {
// MS always use one less than they say
#if defined(Q_OS_WINCE)
@@ -2597,10 +2591,6 @@ QRect QWindowsStyle::subElementRect(SubElement sr, const QStyleOption *opt, cons
return r;
}
-#ifdef QT3_SUPPORT
-Q_GLOBAL_STATIC_WITH_ARGS(QBitmap, globalVerticalLine, (1, 129))
-Q_GLOBAL_STATIC_WITH_ARGS(QBitmap, globalHorizontalLine, (128, 1))
-#endif
/*! \reimp */
void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
@@ -2835,161 +2825,6 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp
}
break;
#endif // QT_NO_SCROLLBAR
-#ifdef QT3_SUPPORT
- case CC_Q3ListView:
- if (const QStyleOptionQ3ListView *lv = qstyleoption_cast<const QStyleOptionQ3ListView *>(opt)) {
- int i;
- if (lv->subControls & SC_Q3ListView)
- QCommonStyle::drawComplexControl(cc, lv, p, widget);
- if (lv->subControls & (SC_Q3ListViewBranch | SC_Q3ListViewExpand)) {
- if (lv->items.isEmpty())
- break;
- QStyleOptionQ3ListViewItem item = lv->items.at(0);
- int y = lv->rect.y();
- int c;
- int dotoffset = 0;
- QPolygon dotlines;
- if ((lv->activeSubControls & SC_All) && (lv->subControls & SC_Q3ListViewExpand)) {
- c = 2;
- dotlines.resize(2);
- dotlines[0] = QPoint(lv->rect.right(), lv->rect.top());
- dotlines[1] = QPoint(lv->rect.right(), lv->rect.bottom());
- } else {
- int linetop = 0, linebot = 0;
- // each branch needs at most two lines, ie. four end points
- dotoffset = (item.itemY + item.height - y) % 2;
- 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 = lv->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(lv->palette.mid().color());
- p->drawRect(bx - 4, linebot - 4, 8, 8);
- // plus or minus
- p->setPen(lv->palette.text().color());
- p->drawLine(bx - 2, linebot, bx + 2, linebot);
- if (!(child.state & State_Open))
- p->drawLine(bx, linebot - 2, bx, linebot + 2);
- // dotlinery
- p->setPen(lv->palette.mid().color());
- dotlines[c++] = QPoint(bx, linetop);
- dotlines[c++] = QPoint(bx, linebot - 4);
- dotlines[c++] = QPoint(bx + 5, linebot);
- dotlines[c++] = QPoint(lv->rect.width(), linebot);
- linetop = linebot + 5;
- } else {
- // just dotlinery
- dotlines[c++] = QPoint(bx+1, linebot -1);
- dotlines[c++] = QPoint(lv->rect.width(), linebot -1);
- }
- 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 = lv->rect.height();
-
- if (linetop < linebot) {
- dotlines[c++] = QPoint(bx, linetop);
- dotlines[c++] = QPoint(bx, linebot);
- }
- }
- p->setPen(lv->palette.text().color());
- QBitmap *verticalLine = globalVerticalLine();
- QBitmap *horizontalLine = globalHorizontalLine();
- static bool isInit = false;
- if (!isInit) {
- isInit = true;
- // make 128*1 and 1*128 bitmaps that can be used for
- // drawing the right sort of lines.
- verticalLine->clear();
- horizontalLine->clear();
- QPolygon a(64);
- QPainter p;
- p.begin(verticalLine);
- for(i = 0; i < 64; ++i)
- a.setPoint(i, 0, i * 2 + 1);
- p.setPen(Qt::color1);
- p.drawPoints(a);
- p.end();
- QApplication::flush();
- verticalLine->setMask(*verticalLine);
- p.begin(horizontalLine);
- for(i = 0; i < 64; ++i)
- a.setPoint(i, i * 2 + 1, 0);
- p.setPen(Qt::color1);
- p.drawPoints(a);
- p.end();
- QApplication::flush();
- horizontalLine->setMask(*horizontalLine);
- }
-
- int line; // index into dotlines
- if (lv->subControls & SC_Q3ListViewBranch) for(line = 0; line < c; line += 2) {
- // assumptions here: lines are horizontal or vertical.
- // lines always start with the numerically lowest
- // coordinate.
-
- // point ... relevant coordinate of current point
- // end ..... same coordinate of the end of the current line
- // other ... the other coordinate of the current point/line
- if (dotlines[line].y() == dotlines[line+1].y()) {
- int end = dotlines[line + 1].x();
- int point = dotlines[line].x();
- int other = dotlines[line].y();
- while (point < end) {
- int i = 128;
- if (i + point > end)
- i = end-point;
- p->drawPixmap(point, other, *horizontalLine, 0, 0, i, 1);
- point += i;
- }
- } else {
- int end = dotlines[line + 1].y();
- int point = dotlines[line].y();
- int other = dotlines[line].x();
- int pixmapoffset = ((point & 1) != dotoffset) ? 1 : 0;
- while(point < end) {
- int i = 128;
- if (i + point > end)
- i = end-point;
- p->drawPixmap(other, point, *verticalLine, 0, pixmapoffset, 1, i);
- point += i;
- }
- }
- }
- }
- }
- break;
-#endif // QT3_SUPPORT
#ifndef QT_NO_COMBOBOX
case CC_ComboBox:
if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp
index cbaf16989a..d36de417ad 100644
--- a/src/widgets/styles/qwindowsxpstyle.cpp
+++ b/src/widgets/styles/qwindowsxpstyle.cpp
@@ -3034,11 +3034,6 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
XPThemeData theme(widget, p, QLatin1String("WINDOW"));
if (sub & SC_TitleBarLabel) {
-#ifdef QT3_SUPPORT
- if (widget && widget->inherits("Q3DockWindowTitleBar")) {
- partId = WP_SMALLCAPTION;
- } else
-#endif
partId = (tb->titleBarState & Qt::WindowMinimized) ? WP_MINCAPTION : WP_CAPTION;
theme.rect = option->rect;
if (widget && !widget->isEnabled())
@@ -3410,11 +3405,6 @@ int QWindowsXPStyle::pixelMetric(PixelMetric pm, const QStyleOption *option, con
case PM_TitleBarHeight:
{
-#ifdef QT3_SUPPORT
- if (widget && widget->inherits("Q3DockWindowTitleBar")) {
- res = GetSystemMetrics(SM_CYSMCAPTION) + GetSystemMetrics(SM_CXSIZEFRAME);
- } else
-#endif
if (widget && (widget->windowType() == Qt::Tool))
res = GetSystemMetrics(SM_CYSMCAPTION) + GetSystemMetrics(SM_CXSIZEFRAME);
else