diff options
author | Debao Zhang <dbzhang800@gmail.com> | 2012-03-20 20:21:30 -0700 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-23 13:22:10 +0100 |
commit | 2f2b78321427daa8c7f0702140c297d22b0bf3c8 (patch) | |
tree | ed358dc4de958dc7e52be1dc8282237c3f073969 /src/widgets/styles/qwindowsxpstyle.cpp | |
parent | f31e614245e796c7f82ec33eed708902d4d01521 (diff) |
Remove QWorkspace.
QWorkspace had been called Q3Workspace before Qt4.0 finally released.
In a sense, it is a Qt3 support Widget. And QWorkspace has been
deprecated and replaced by QMdiArea at Qt4.3.
Change-Id: Iea1bf831c9960c23c2b21d51fdc7c13b303642ea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/widgets/styles/qwindowsxpstyle.cpp')
-rw-r--r-- | src/widgets/styles/qwindowsxpstyle.cpp | 101 |
1 files changed, 4 insertions, 97 deletions
diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp index a342486339..f57da855fb 100644 --- a/src/widgets/styles/qwindowsxpstyle.cpp +++ b/src/widgets/styles/qwindowsxpstyle.cpp @@ -1178,8 +1178,9 @@ void QWindowsXPStyle::polish(QWidget *widget) || qobject_cast<QAbstractSpinBox*>(widget) || qobject_cast<QSpinBox*>(widget) #endif // QT_NO_SPINBOX - || widget->inherits("QWorkspaceChild")) + ) { widget->setAttribute(Qt::WA_Hover); + } #ifndef QT_NO_RUBBERBAND if (qobject_cast<QRubberBand*>(widget)) { @@ -1249,8 +1250,9 @@ void QWindowsXPStyle::unpolish(QWidget *widget) || qobject_cast<QAbstractSpinBox*>(widget) || qobject_cast<QSpinBox*>(widget) #endif // QT_NO_SPINBOX - || widget->inherits("QWorkspaceChild")) + ) { widget->setAttribute(Qt::WA_Hover, false); + } QWindowsStyle::unpolish(widget); } @@ -3225,63 +3227,6 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo } break; -#ifndef QT_NO_WORKSPACE - case CC_MdiControls: - { - QRect buttonRect; - XPThemeData theme(widget, p, QLatin1String("WINDOW"), 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)) @@ -3667,44 +3612,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, |