From 181df199d31a8018cfcfc31b548909fe4b57ccbd Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 3 May 2011 22:37:25 +0200 Subject: remove more QT3_SUPPORT code --- src/gui/kernel/kernel.pri | 4 +- src/gui/kernel/qcursor.h | 12 -- src/gui/kernel/qdnd_x11.cpp | 4 - src/gui/kernel/qevent.cpp | 232 ------------------------------ src/gui/kernel/qevent.h | 77 ---------- src/gui/kernel/qguivariant.cpp | 28 ---- src/gui/kernel/qpalette.cpp | 315 ----------------------------------------- src/gui/kernel/qpalette.h | 73 ---------- src/gui/kernel/qwidget.cpp | 5 - src/gui/kernel/qwidget.h | 3 - src/gui/kernel/qwindowdefs.h | 3 - 11 files changed, 2 insertions(+), 754 deletions(-) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri index ea86977cf6..09ef146597 100644 --- a/src/gui/kernel/kernel.pri +++ b/src/gui/kernel/kernel.pri @@ -67,8 +67,8 @@ SOURCES += \ kernel/qlayout.cpp \ kernel/qlayoutengine.cpp \ kernel/qlayoutitem.cpp \ - kernel/qmime.cpp \ - kernel/qpalette.cpp \ + kernel/qmime.cpp \ + kernel/qpalette.cpp \ kernel/qshortcut.cpp \ kernel/qshortcutmap.cpp \ kernel/qstackedlayout.cpp \ diff --git a/src/gui/kernel/qcursor.h b/src/gui/kernel/qcursor.h index c993763634..b47ec04d66 100644 --- a/src/gui/kernel/qcursor.h +++ b/src/gui/kernel/qcursor.h @@ -152,18 +152,6 @@ private: #endif }; -#ifdef QT3_SUPPORT -// CursorShape is defined in X11/X.h -#ifdef CursorShape -#define X_CursorShape CursorShape -#undef CursorShape -#endif -typedef Qt::CursorShape QCursorShape; -#ifdef X_CursorShape -#define CursorShape X_CursorShape -#endif -#endif - /***************************************************************************** QCursor stream functions *****************************************************************************/ diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp index 1c59d41a94..9ff1543e51 100644 --- a/src/gui/kernel/qdnd_x11.cpp +++ b/src/gui/kernel/qdnd_x11.cpp @@ -1350,10 +1350,6 @@ bool QDragManager::eventFilter(QObject * o, QEvent * e) case QEvent::KeyRelease: case QEvent::Wheel: case QEvent::ShortcutOverride: -#ifdef QT3_SUPPORT - case QEvent::Accel: - case QEvent::AccelAvailable: -#endif return true; default: return false; diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 277a5e845d..5f0cfd7d69 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -180,36 +180,6 @@ QMouseEvent::~QMouseEvent() { } -#ifdef QT3_SUPPORT -/*! - Use QMouseEvent(\a type, \a pos, \a button, \c buttons, \c - modifiers) instead, where \c buttons is \a state & - Qt::MouseButtonMask and \c modifiers is \a state & - Qt::KeyButtonMask. -*/ -QMouseEvent::QMouseEvent(Type type, const QPoint &pos, Qt::ButtonState button, int state) - : QInputEvent(type), p(pos), b((Qt::MouseButton)button) -{ - g = QCursor::pos(); - mouseState = Qt::MouseButtons((state ^ b) & Qt::MouseButtonMask); - modState = Qt::KeyboardModifiers(state & (int)Qt::KeyButtonMask); -} - -/*! - Use QMouseEvent(\a type, \a pos, \a globalPos, \a button, - \c buttons, \c modifiers) instead, where - \c buttons is \a state & Qt::MouseButtonMask and - \c modifiers is \a state & Qt::KeyButtonMask. -*/ -QMouseEvent::QMouseEvent(Type type, const QPoint &pos, const QPoint &globalPos, - Qt::ButtonState button, int state) - : QInputEvent(type), p(pos), g(globalPos), b((Qt::MouseButton)button) -{ - mouseState = Qt::MouseButtons((state ^ b) & Qt::MouseButtonMask); - modState = Qt::KeyboardModifiers(state & (int)Qt::KeyButtonMask); -} -#endif - /*! Constructs a mouse event object. @@ -557,19 +527,6 @@ QWheelEvent::~QWheelEvent() { } -#ifdef QT3_SUPPORT -/*! - Use one of the other constructors instead. -*/ -QWheelEvent::QWheelEvent(const QPoint &pos, int delta, int state, Qt::Orientation orient) - : QInputEvent(Wheel), p(pos), d(delta), o(orient) -{ - g = QCursor::pos(); - mouseState = Qt::MouseButtons(state & Qt::MouseButtonMask); - modState = Qt::KeyboardModifiers(state & (int)Qt::KeyButtonMask); -} -#endif - /*! Constructs a wheel event object. @@ -587,18 +544,6 @@ QWheelEvent::QWheelEvent(const QPoint &pos, const QPoint& globalPos, int delta, : QInputEvent(Wheel, modifiers), p(pos), g(globalPos), d(delta), mouseState(buttons), o(orient) {} -#ifdef QT3_SUPPORT -/*! - Use one of the other constructors instead. -*/ -QWheelEvent::QWheelEvent(const QPoint &pos, const QPoint& globalPos, int delta, int state, - Qt::Orientation orient) - : QInputEvent(Wheel), p(pos), g(globalPos), d(delta), o(orient) -{ - mouseState = Qt::MouseButtons(state & Qt::MouseButtonMask); - modState = Qt::KeyboardModifiers(state & (int) Qt::KeyButtonMask); -} -#endif #endif // QT_NO_WHEELEVENT /*! @@ -992,34 +937,6 @@ bool QKeyEvent::matches(QKeySequence::StandardKey matchKey) const \sa Qt::WA_KeyCompression */ -#ifdef QT3_SUPPORT -/*! - \fn QKeyEvent::QKeyEvent(Type type, int key, int ascii, - int modifiers, const QString &text, - bool autorep, ushort count) - - Use one of the other constructors instead. -*/ - -/*! - \fn int QKeyEvent::ascii() const - - Use text() instead. -*/ - -/*! - \fn Qt::ButtonState QKeyEvent::state() const - - Use QInputEvent::modifiers() instead. -*/ - -/*! - \fn Qt::ButtonState QKeyEvent::stateAfter() const - - Use modifiers() instead. -*/ -#endif - /*! \class QFocusEvent \brief The QFocusEvent class contains event parameters for widget focus @@ -1090,23 +1007,6 @@ Qt::FocusReason QFocusEvent::reason() const false. */ -#ifdef QT3_SUPPORT -/*! - \enum QFocusEvent::Reason - \compat - - Use Qt::FocusReason instead. - - \value Mouse Same as Qt::MouseFocusReason. - \value Tab Same as Qt::TabFocusReason. - \value Backtab Same as Qt::BacktabFocusReason. - \value MenuBar Same as Qt::MenuBarFocusReason. - \value ActiveWindow Same as Qt::ActiveWindowFocusReason - \value Other Same as Qt::OtherFocusReason - \value Popup Same as Qt::PopupFocusReason - \value Shortcut Same as Qt::ShortcutFocusReason -*/ -#endif /*! \class QPaintEvent @@ -1175,18 +1075,6 @@ QPaintEvent::QPaintEvent(const QRect &paintRect) {} -#ifdef QT3_SUPPORT - /*! - Constructs a paint event object with both a \a paintRegion and a - \a paintRect, both of which represent the area of the widget that - needs to be updated. - -*/ -QPaintEvent::QPaintEvent(const QRegion &paintRegion, const QRect &paintRect) - : QEvent(Paint), m_rect(paintRect), m_region(paintRegion), m_erased(false) -{} -#endif - /*! \internal */ @@ -1453,17 +1341,6 @@ QContextMenuEvent::QContextMenuEvent(Reason reason, const QPoint &pos, const QPo : QInputEvent(ContextMenu, modifiers), p(pos), gp(globalPos), reas(reason) {} -#ifdef QT3_SUPPORT -/*! - Constructs a context menu event with the given \a reason for the - position specified by \a pos in widget coordinates and \a globalPos - in global screen coordinates. \a dummy is ignored. -*/ -QContextMenuEvent::QContextMenuEvent(Reason reason, const QPoint &pos, const QPoint &globalPos, - int /* dummy */) - : QInputEvent(ContextMenu), p(pos), gp(globalPos), reas(reason) -{} -#endif /*! \internal */ QContextMenuEvent::~QContextMenuEvent() @@ -1489,24 +1366,6 @@ QContextMenuEvent::QContextMenuEvent(Reason reason, const QPoint &pos) gp = QCursor::pos(); } -#ifdef QT3_SUPPORT -/*! - Constructs a context menu event with the given \a reason for the - position specified by \a pos in widget coordinates. \a dummy is - ignored. -*/ -QContextMenuEvent::QContextMenuEvent(Reason reason, const QPoint &pos, int /* dummy */) - : QInputEvent(ContextMenu), p(pos), reas(reason) -{ - gp = QCursor::pos(); -} - -Qt::ButtonState QContextMenuEvent::state() const -{ - return Qt::ButtonState(int(QApplication::keyboardModifiers())|QApplication::mouseButtons()); -} -#endif - /*! \fn const QPoint &QContextMenuEvent::pos() const @@ -2538,37 +2397,6 @@ void QDropEvent::setDropAction(Qt::DropAction action) \sa setDropAction(), proposedAction(), {QEvent::accept()}{accept()} */ -#ifdef QT3_SUPPORT -/*! - Use dropAction() instead. - - The table below shows the correspondance between the return type - of action() and the return type of dropAction(). - - \table - \header \i Old enum value \i New enum value - \row \i QDropEvent::Copy \i Qt::CopyAction - \row \i QDropEvent::Move \i Qt::MoveAction - \row \i QDropEvent::Link \i Qt::LinkAction - \row \i other \i Qt::CopyAction - \endtable -*/ - -QT3_SUPPORT QDropEvent::Action QDropEvent::action() const -{ - switch(drop_action) { - case Qt::CopyAction: - return Copy; - case Qt::MoveAction: - return Move; - case Qt::LinkAction: - return Link; - default: - return Copy; - } -} -#endif - /*! \fn void QDropEvent::setPoint(const QPoint &point) \compat @@ -3471,12 +3299,6 @@ QDebug operator<<(QDebug dbg, const QEvent *e) { case QEvent::UngrabKeyboard: n = "UngrabKeyboard"; break; -#ifdef QT3_SUPPORT - case QEvent::ChildInsertedRequest: - n = "ChildInsertedRequest"; - break; - case QEvent::ChildInserted: n = "ChildInserted"; -#endif case QEvent::ChildAdded: n = n ? n : "ChildAdded"; case QEvent::ChildPolished: n = n ? n : "ChildPolished"; case QEvent::ChildRemoved: n = n ? n : "ChildRemoved"; @@ -3628,60 +3450,6 @@ QWindowStateChangeEvent::~QWindowStateChangeEvent() { } -#ifdef QT3_SUPPORT - -/*! - \class QMenubarUpdatedEvent - \internal - Event sent by QMenuBar to tell Q3Workspace to update itself. -*/ - -/*! \internal - -*/ -QMenubarUpdatedEvent::QMenubarUpdatedEvent(QMenuBar * const menuBar) -:QEvent(QEvent::MenubarUpdated), m_menuBar(menuBar) {} - -/*! - \fn QMenuBar *QMenubarUpdatedEvent::menuBar() - \internal -*/ - -/*! - \fn bool operator==(QKeyEvent *e, QKeySequence::StandardKey key) - - \relates QKeyEvent - - Returns true if \a key is currently bound to the key combination - specified by \a e. - - Equivalent to \c {e->matches(key)}. -*/ - -/*! - \fn bool operator==(QKeySequence::StandardKey key, QKeyEvent *e) - - \relates QKeyEvent - - Returns true if \a key is currently bound to the key combination - specified by \a e. - - Equivalent to \c {e->matches(key)}. -*/ - -/*! - \internal - - \class QKeyEventEx - \ingroup events - - \brief The QKeyEventEx class provides more extended information about a keyevent. - - This class is for internal use only, and exists to aid the shortcut system on - various platforms to get all the information it needs. -*/ - -#endif /*! \class QTouchEvent diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 93c2bc53b6..6128db4a64 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -107,15 +107,6 @@ public: inline bool hasExtendedInfo() const { return reinterpret_cast(d) == this; } QPointF posF() const; -#ifdef QT3_SUPPORT - QT3_SUPPORT_CONSTRUCTOR QMouseEvent(Type type, const QPoint &pos, Qt::ButtonState button, int state); - QT3_SUPPORT_CONSTRUCTOR QMouseEvent(Type type, const QPoint &pos, const QPoint &globalPos, - Qt::ButtonState button, int state); - inline QT3_SUPPORT Qt::ButtonState state() const - { return Qt::ButtonState((mouseState^b)|int(modifiers())); } - inline QT3_SUPPORT Qt::ButtonState stateAfter() const - { return Qt::ButtonState(int(mouseState)|int(modifiers())); } -#endif protected: QPoint p, g; Qt::MouseButton b; @@ -158,14 +149,6 @@ public: inline Qt::MouseButtons buttons() const { return mouseState; } Qt::Orientation orientation() const { return o; } -#ifdef QT3_SUPPORT - QT3_SUPPORT_CONSTRUCTOR QWheelEvent(const QPoint &pos, int delta, int state, - Qt::Orientation orient = Qt::Vertical); - QT3_SUPPORT_CONSTRUCTOR QWheelEvent(const QPoint &pos, const QPoint& globalPos, int delta, int state, - Qt::Orientation orient = Qt::Vertical); - inline QT3_SUPPORT Qt::ButtonState state() const - { return static_cast(int(buttons())|int(modifiers())); } -#endif protected: QPoint p; QPoint g; @@ -248,22 +231,6 @@ public: quint32 nativeVirtualKey() const; quint32 nativeModifiers() const; -#ifdef QT3_SUPPORT - inline QT3_SUPPORT_CONSTRUCTOR QKeyEvent(Type type, int key, int /*ascii*/, - int modifiers, const QString& text = QString(), - bool autorep = false, ushort count = 1) - : QInputEvent(type, Qt::KeyboardModifiers(modifiers & (int)Qt::KeyButtonMask)), txt(text), k(key), - c(count), autor(autorep) - { - if (key >= Qt::Key_Back && key <= Qt::Key_MediaLast) - ignore(); - } - inline QT3_SUPPORT int ascii() const - { return (txt.length() ? txt.unicode()->toLatin1() : 0); } - inline QT3_SUPPORT Qt::ButtonState state() const { return Qt::ButtonState(QInputEvent::modifiers()); } - inline QT3_SUPPORT Qt::ButtonState stateAfter() const { return Qt::ButtonState(modifiers()); } -#endif - protected: QString txt; int k; @@ -281,12 +248,6 @@ public: inline bool gotFocus() const { return type() == FocusIn; } inline bool lostFocus() const { return type() == FocusOut; } -#ifdef QT3_SUPPORT - enum Reason { Mouse=Qt::MouseFocusReason, Tab=Qt::TabFocusReason, - Backtab=Qt::BacktabFocusReason, MenuBar=Qt::MenuBarFocusReason, - ActiveWindow=Qt::ActiveWindowFocusReason, Other=Qt::OtherFocusReason, - Popup=Qt::PopupFocusReason, Shortcut=Qt::ShortcutFocusReason }; -#endif Qt::FocusReason reason(); Qt::FocusReason reason() const; @@ -305,12 +266,6 @@ public: inline const QRect &rect() const { return m_rect; } inline const QRegion ®ion() const { return m_region; } -#ifdef QT3_SUPPORT - QT3_SUPPORT_CONSTRUCTOR QPaintEvent(const QRegion &paintRegion, const QRect &paintRect); - inline QT3_SUPPORT bool erased() const { return m_erased; } - inline QT3_SUPPORT void setErased(bool b) { m_erased = b; } -#endif - protected: friend class QApplication; friend class QCoreApplication; @@ -414,12 +369,6 @@ public: inline Reason reason() const { return Reason(reas); } -#ifdef QT3_SUPPORT - QT3_SUPPORT_CONSTRUCTOR QContextMenuEvent(Reason reason, const QPoint &pos, const QPoint &globalPos, int); - QT3_SUPPORT_CONSTRUCTOR QContextMenuEvent(Reason reason, const QPoint &pos, int); - - QT3_SUPPORT Qt::ButtonState state() const; -#endif protected: QPoint p; QPoint gp; @@ -502,16 +451,6 @@ public: QByteArray encodedData(const char*) const; bool provides(const char*) const; // END QT3_SUPPORT -#ifdef QT3_SUPPORT - inline void accept() { QEvent::accept(); } - inline QT3_SUPPORT void accept(bool y) { setAccepted(y); } - inline QT3_SUPPORT QByteArray data(const char* f) const { return encodedData(f); } - - enum Action { Copy, Link, Move, Private, UserAction = Private }; - QT3_SUPPORT Action action() const; - inline QT3_SUPPORT void acceptAction(bool y = true) { if (y) { drop_action = default_action; accept(); } } - inline QT3_SUPPORT void setPoint(const QPoint& np) { p = np; } -#endif protected: @@ -542,10 +481,6 @@ public: inline void accept(const QRect & r) { accept(); rect = r; } inline void ignore(const QRect & r) { ignore(); rect = r; } -#ifdef QT3_SUPPORT - inline QT3_SUPPORT void accept(bool y) { setAccepted(y); } -#endif - protected: friend class QApplication; QRect rect; @@ -716,18 +651,6 @@ private: Qt::WindowStates ostate; }; -#ifdef QT3_SUPPORT -class QMenuBar; -class Q_GUI_EXPORT QMenubarUpdatedEvent: public QEvent -{ -public: - QMenubarUpdatedEvent(QMenuBar * const menBar); - inline QMenuBar *menuBar() { return m_menuBar; } -private: - QMenuBar *m_menuBar; -}; -#endif - #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QEvent *); #endif diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp index badff80834..ef0cfc987c 100644 --- a/src/gui/kernel/qguivariant.cpp +++ b/src/gui/kernel/qguivariant.cpp @@ -70,10 +70,6 @@ QT_BEGIN_NAMESPACE -#ifdef QT3_SUPPORT -extern QDataStream &qt_stream_out_qcolorgroup(QDataStream &s, const QColorGroup &g); -extern QDataStream &qt_stream_in_qcolorgroup(QDataStream &s, QColorGroup &g); -#endif Q_CORE_EXPORT const QVariant::Handler *qcoreVariantHandler(); @@ -107,11 +103,6 @@ static void construct(QVariant::Private *x, const void *copy) case QVariant::Palette: v_construct(x, copy); break; -#ifdef QT3_SUPPORT - case QVariant::ColorGroup: - v_construct(x, copy); - break; -#endif #ifndef QT_NO_ICON case QVariant::Icon: v_construct(x, copy); @@ -218,11 +209,6 @@ static void clear(QVariant::Private *d) case QVariant::Palette: v_clear(d); break; -#ifdef QT3_SUPPORT - case QVariant::ColorGroup: - v_clear(d); - break; -#endif #ifndef QT_NO_ICON case QVariant::Icon: v_clear(d); @@ -313,9 +299,6 @@ static bool isNull(const QVariant::Private *d) case QVariant::Brush: case QVariant::Color: case QVariant::Palette: -#ifdef QT3_SUPPORT - case QVariant::ColorGroup: -#endif case QVariant::SizePolicy: #ifndef QT_NO_SHORTCUT case QVariant::KeySequence: @@ -374,10 +357,6 @@ static bool compare(const QVariant::Private *a, const QVariant::Private *b) return *v_cast(a) == *v_cast(b); case QVariant::Palette: return *v_cast(a) == *v_cast(b); -#ifdef QT3_SUPPORT - case QVariant::ColorGroup: - return *v_cast(a) == *v_cast(b); -#endif #ifndef QT_NO_ICON case QVariant::Icon: /* QIcon::operator==() cannot be reasonably implemented for QIcon, @@ -688,9 +667,6 @@ extern Q_CORE_EXPORT const QMetaTypeGuiHelper *qMetaTypeGuiHelper; static const QLoad##TYPE qLoad##TYPE = qMetaTypeLoadHelper; #endif -#ifdef QT3_SUPPORT -Q_DECL_METATYPE_HELPER(QColorGroup) -#endif Q_DECL_METATYPE_HELPER(QFont) Q_DECL_METATYPE_HELPER(QPixmap) Q_DECL_METATYPE_HELPER(QBrush) @@ -745,11 +721,7 @@ Q_DECL_METATYPE_HELPER(QQuaternion) #endif static const QMetaTypeGuiHelper qVariantGuiHelper[] = { -#ifdef QT3_SUPPORT - Q_IMPL_METATYPE_HELPER(QColorGroup), -#else {0, 0, 0, 0}, -#endif Q_IMPL_METATYPE_HELPER(QFont), Q_IMPL_METATYPE_HELPER(QPixmap), Q_IMPL_METATYPE_HELPER(QBrush), diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp index 490d442616..f0117b46e5 100644 --- a/src/gui/kernel/qpalette.cpp +++ b/src/gui/kernel/qpalette.cpp @@ -63,103 +63,6 @@ static QColor qt_mix_colors(QColor a, QColor b) (a.blue() + b.blue()) / 2, (a.alpha() + b.alpha()) / 2); } -#ifdef QT3_SUPPORT - -#ifndef QT_NO_DATASTREAM -QDataStream &qt_stream_out_qcolorgroup(QDataStream &s, const QColorGroup &g) -{ - if(s.version() == 1) { - // Qt 1.x - s << g.color(QPalette::Foreground) << g.color(QPalette::Background) - << g.color(QPalette::Light) << g.color(QPalette::Dark) - << g.color(QPalette::Mid) << g.color(QPalette::Text) << g.color(QPalette::Base); - } else { - int max = QPalette::NColorRoles; - if (s.version() <= QDataStream::Qt_2_1) - max = QPalette::HighlightedText + 1; - else if (s.version() <= QDataStream::Qt_4_3) - max = QPalette::AlternateBase + 1; - for(int r = 0 ; r < max ; r++) - s << g.brush((QPalette::ColorRole)r); - } - return s; -} - -QDataStream &qt_stream_in_qcolorgroup(QDataStream &s, QColorGroup &g) -{ - if(s.version() == 1) { // Qt 1.x - QColor fg, bg, light, dark, mid, text, base; - s >> fg >> bg >> light >> dark >> mid >> text >> base; - QPalette p(bg); - p.setColor(QPalette::Active, QPalette::Foreground, fg); - p.setColor(QPalette::Active, QPalette::Light, light); - p.setColor(QPalette::Active, QPalette::Dark, dark); - p.setColor(QPalette::Active, QPalette::Mid, mid); - p.setColor(QPalette::Active, QPalette::Text, text); - p.setColor(QPalette::Active, QPalette::Base, base); - g = p; - g.setCurrentColorGroup(QPalette::Active); - } else { - int max = QPalette::NColorRoles; - if (s.version() <= QDataStream::Qt_2_1) - max = QPalette::HighlightedText + 1; - else if (s.version() <= QDataStream::Qt_3_0) - max = QPalette::LinkVisited + 1; - else if (s.version() <= QDataStream::Qt_4_3) - max = QPalette::AlternateBase + 1; - QBrush tmp; - for(int r = 0 ; r < max; r++) { - s >> tmp; - g.setBrush((QPalette::ColorRole)r, tmp); - } - } - return s; -} - -QDataStream &operator<<(QDataStream &s, const QColorGroup &g) -{ - return qt_stream_out_qcolorgroup(s, g); -} - -QDataStream &operator>>(QDataStream &s, QColorGroup &g) -{ - return qt_stream_in_qcolorgroup(s, g); -} -#endif // QT_NO_DATASTREAM - -/*! - Constructs a palette with the specified \a active, \a disabled and - \a inactive color groups. -*/ -QPalette::QPalette(const QColorGroup &active, const QColorGroup &disabled, - const QColorGroup &inactive) -{ - Q_ASSERT(QPalette::NColorRoles == QPalette::ToolTipText + 1); - init(); - setColorGroup(Active, active); - setColorGroup(Disabled, disabled); - setColorGroup(Inactive, inactive); -} - -QColorGroup QPalette::createColorGroup(ColorGroup cr) const -{ - QColorGroup ret(*this); - ret.setCurrentColorGroup(cr); - return ret; -} - -void QPalette::setColorGroup(ColorGroup cg, const QColorGroup &g) -{ - setColorGroup(cg, g.brush(WindowText), g.brush(Button), g.brush(Light), - g.brush(Dark), g.brush(Mid), g.brush(Text), g.brush(BrightText), - g.brush(Base), g.brush(AlternateBase), g.brush(Window), - g.brush(Midlight), g.brush(ButtonText), g.brush(Shadow), - g.brush(Highlight), g.brush(HighlightedText), g.brush(Link), - g.brush(LinkVisited), g.brush(ToolTipBase), g.brush(ToolTipText)); -} - -#endif // QT3_SUPPORT - /*! \fn const QColor &QPalette::color(ColorRole role) const @@ -897,27 +800,6 @@ bool QPalette::operator==(const QPalette &p) const return true; } -#ifdef QT3_SUPPORT -bool QColorGroup::operator==(const QColorGroup &other) const -{ - if (isCopyOf(other)) - return true; - for (int role = 0; role < int(NColorRoles); role++) { - if(d->br[current_group][role] != other.d->br[other.current_group][role]) - return false; - } - return true; -} - -/*! - Returns the color group as a QVariant -*/ -QColorGroup::operator QVariant() const -{ - return QVariant(QVariant::ColorGroup, this); -} -#endif - /*! \fn bool QPalette::isEqual(ColorGroup cg1, ColorGroup cg2) const @@ -1205,202 +1087,5 @@ void QPalette::setColorGroup(ColorGroup cg, const QBrush &foreground, const QBru Use simple assignment instead. */ -/*! - \fn QColorGroup QPalette::normal() const - \obsolete - - Returns the active color group. Use active() instead. - - Use createColorGroup(Active) instead. -*/ - -/*! - \fn void QPalette::setNormal(const QColorGroup &colorGroup) - - Sets the normal color group to \a colorGroup. - - \sa QColorGroup -*/ - -/*! - \fn QColorGroup QPalette::active() const - - Returns the active color group. - \sa QColorGroup -*/ - -/*! - \fn QColorGroup QPalette::disabled() const - - Returns the disabled color group. - \sa QColorGroup -*/ - -/*! - \fn QColorGroup QPalette::inactive() const - - Returns the inactive color group. - \sa QColorGroup -*/ - -/*! - \fn void QPalette::setActive(const QColorGroup &colorGroup) - - Sets the active color group to \a colorGroup. - \sa QColorGroup -*/ - -/*! - \fn void QPalette::setDisabled(const QColorGroup &colorGroup) - - Sets the disabled color group to \a colorGroup. - \sa QColorGroup -*/ - -/*! - \fn void QPalette::setInactive(const QColorGroup &colorGroup) - - Sets the inactive color group. - \sa QColorGroup -*/ - -/*! \class QColorGroup - \brief The QColorGroup class contains color groups for each widget state. - \compat -*/ - -/*! \fn QColorGroup::QColorGroup() - - Use QPalette() instead. -*/ - -/*! \fn QColorGroup::QColorGroup(const QBrush &foreground, const QBrush &button, \ - const QBrush &light, const QBrush &dark, const QBrush &mid, \ - const QBrush &text, const QBrush &bright_text, - const QBrush &base, const QBrush &background) - - Use QPalette(\a foreground, \a button, \a light, \a dark, \a mid, - \a text, \a bright_text, \a base, \a background) instead. -*/ - -/*! \fn QColorGroup::QColorGroup(const QColor &foreground, const QColor &background, \ - const QColor &light, const QColor &dark, const QColor &mid, \ - const QColor &text, const QColor &base) - - Use QColorGroup(\a foreground, \a background, \a light, \a dark, - \a mid, \a text, \a base) instead. -*/ - -/*! \fn QColorGroup::QColorGroup(const QColorGroup &other) - - Use QPalette(\a other) instead. -*/ - -/*! \fn QColorGroup::QColorGroup(const QPalette &pal) - - Use QPalette(\a pal) instead. -*/ - -/*! \fn const QColor &QColorGroup::foreground() const - - Use QPalette::windowText().color() instead. -*/ - -/*! \fn const QColor &QColorGroup::button() const - - Use QPalette::button().color() instead. -*/ - -/*! \fn const QColor &QColorGroup::light() const - - Use QPalette::light().color() instead. -*/ - -/*! \fn const QColor &QColorGroup::dark() const - - Use QPalette::dark().color() instead. -*/ - -/*! \fn const QColor &QColorGroup::mid() const - - Use QPalette::mid().color() instead. -*/ - -/*! \fn const QColor &QColorGroup::text() const - - Use QPalette::text().color() instead. -*/ - -/*! \fn const QColor &QColorGroup::base() const - - Use QPalette::base().color() instead. -*/ - -/*! \fn const QColor &QColorGroup::background() const - - Use QPalette::window().color() instead. -*/ - -/*! \fn const QColor &QColorGroup::midlight() const - - Use QPalette::midlight().color() instead. -*/ - -/*! \fn const QColor &QColorGroup::brightText() const - - Use QPalette::brightText().color() instead. -*/ - -/*! \fn const QColor &QColorGroup::buttonText() const - - Use QPalette::buttonText().color() instead. -*/ - -/*! \fn const QColor &QColorGroup::shadow() const - - Use QPalette::shadow().color() instead. -*/ - -/*! \fn const QColor &QColorGroup::highlight() const - - Use QPalette::highlight().color() instead. -*/ - -/*! \fn const QColor &QColorGroup::highlightedText() const - - Use QPalette::highlightedText().color() instead. -*/ - -/*! \fn const QColor &QColorGroup::link() const - - Use QPalette::link().color() instead. -*/ - -/*! \fn const QColor &QColorGroup::linkVisited() const - - Use QPalette::linkVisited().color() instead. -*/ - -/*! \fn QDataStream &operator<<(QDataStream &ds, const QColorGroup &colorGroup) - \relates QColorGroup - \compat -*/ - -/*! \fn QDataStream &operator>>(QDataStream &ds, QColorGroup &colorGroup) - \relates QColorGroup - \compat -*/ - -/*! \fn bool QColorGroup::operator==(const QColorGroup &other) const - - Returns true if this color group is equal to \a other; otherwise - returns false. -*/ - -/*! \fn bool QColorGroup::operator!=(const QColorGroup &other) const - - Returns true if this color group is not equal to \a other; - otherwise returns false. -*/ QT_END_NAMESPACE diff --git a/src/gui/kernel/qpalette.h b/src/gui/kernel/qpalette.h index dffd2cbec8..17f3d0f653 100644 --- a/src/gui/kernel/qpalette.h +++ b/src/gui/kernel/qpalette.h @@ -52,9 +52,6 @@ QT_BEGIN_NAMESPACE QT_MODULE(Gui) -#ifdef QT3_SUPPORT -class QColorGroup; -#endif class QPalettePrivate; class QVariant; @@ -72,9 +69,6 @@ public: const QBrush &bright_text, const QBrush &base, const QBrush &window); QPalette(const QColor &windowText, const QColor &window, const QColor &light, const QColor &dark, const QColor &mid, const QColor &text, const QColor &base); -#ifdef QT3_SUPPORT - QT3_SUPPORT_CONSTRUCTOR QPalette(const QColorGroup &active, const QColorGroup &disabled, const QColorGroup &inactive); -#endif QPalette(const QPalette &palette); ~QPalette(); QPalette &operator=(const QPalette &palette); @@ -142,19 +136,6 @@ public: inline const QBrush &link() const { return brush(Link); } inline const QBrush &linkVisited() const { return brush(LinkVisited); } -#ifdef QT3_SUPPORT - inline QT3_SUPPORT QPalette copy() const { QPalette p = *this; p.detach(); return p; } - QT3_SUPPORT QColorGroup normal() const; - inline QT3_SUPPORT void setNormal(const QColorGroup &cg) { setColorGroup(Active, cg); } - - QT3_SUPPORT QColorGroup active() const; - QT3_SUPPORT QColorGroup disabled() const; - QT3_SUPPORT QColorGroup inactive() const; - inline QT3_SUPPORT void setActive(const QColorGroup &cg) { setColorGroup(Active, cg); } - inline QT3_SUPPORT void setDisabled(const QColorGroup &cg) { setColorGroup(Disabled, cg); } - inline QT3_SUPPORT void setInactive(const QColorGroup &cg) { setColorGroup(Inactive, cg); } -#endif - bool operator==(const QPalette &p) const; inline bool operator!=(const QPalette &p) const { return !(operator==(p)); } bool isCopyOf(const QPalette &p) const; @@ -184,11 +165,6 @@ private: const QBrush &highlight, const QBrush &highlighted_text, const QBrush &link, const QBrush &link_visited, const QBrush &toolTipBase, const QBrush &toolTipText); -#ifdef QT3_SUPPORT - friend class QColorGroup; - void setColorGroup(ColorGroup, const QColorGroup &); - QColorGroup createColorGroup(ColorGroup) const; -#endif void init(); void detach(); @@ -206,55 +182,6 @@ inline void QPalette::setColor(ColorRole acr, const QColor &acolor) inline void QPalette::setBrush(ColorRole acr, const QBrush &abrush) { setBrush(All, acr, abrush); } -#ifdef QT3_SUPPORT -class Q_GUI_EXPORT QColorGroup : public QPalette -{ -public: - inline QColorGroup() : QPalette() {} - inline QColorGroup(const QBrush &foreground, const QBrush &button, const QBrush &light, - const QBrush &dark, const QBrush &mid, const QBrush &text, - const QBrush &bright_text, const QBrush &base, const QBrush &background) - : QPalette(foreground, button, light, dark, mid, text, bright_text, base, background) - {} - inline QColorGroup(const QColor &foreground, const QColor &background, const QColor &light, - const QColor &dark, const QColor &mid, const QColor &text, const QColor &base) - : QPalette(foreground, background, light, dark, mid, text, base) {} - inline QColorGroup(const QColorGroup &cg) : QPalette(cg) {} - inline QColorGroup(const QPalette &pal) : QPalette(pal) {} - bool operator==(const QColorGroup &other) const; - inline bool operator!=(const QColorGroup &other) const { return !(operator==(other)); } - operator QVariant() const; - - inline QT3_SUPPORT const QColor &foreground() const { return color(WindowText); } - inline QT3_SUPPORT const QColor &button() const { return color(Button); } - inline QT3_SUPPORT const QColor &light() const { return color(Light); } - inline QT3_SUPPORT const QColor &dark() const { return color(Dark); } - inline QT3_SUPPORT const QColor &mid() const { return color(Mid); } - inline QT3_SUPPORT const QColor &text() const { return color(Text); } - inline QT3_SUPPORT const QColor &base() const { return color(Base); } - inline QT3_SUPPORT const QColor &background() const { return color(Window); } - inline QT3_SUPPORT const QColor &midlight() const { return color(Midlight); } - inline QT3_SUPPORT const QColor &brightText() const { return color(BrightText); } - inline QT3_SUPPORT const QColor &buttonText() const { return color(ButtonText); } - inline QT3_SUPPORT const QColor &shadow() const { return color(Shadow); } - inline QT3_SUPPORT const QColor &highlight() const { return color(Highlight); } - inline QT3_SUPPORT const QColor &highlightedText() const { return color(HighlightedText); } - inline QT3_SUPPORT const QColor &link() const { return color(Link); } - inline QT3_SUPPORT const QColor &linkVisited() const { return color(LinkVisited); } -}; - -#ifndef QT_NO_DATASTREAM -Q_GUI_EXPORT QT3_SUPPORT QDataStream &operator<<(QDataStream &ds, const QColorGroup &cg); -Q_GUI_EXPORT QT3_SUPPORT QDataStream &operator>>(QDataStream &ds, QColorGroup &cg); -#endif - -inline QColorGroup QPalette::inactive() const { return createColorGroup(Inactive); } -inline QColorGroup QPalette::disabled() const { return createColorGroup(Disabled); } -inline QColorGroup QPalette::active() const { return createColorGroup(Active); } -inline QColorGroup QPalette::normal() const { return createColorGroup(Active); } - -#endif - /***************************************************************************** QPalette stream functions *****************************************************************************/ diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index e1f9ee70ce..7022c38581 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -11692,11 +11692,6 @@ void QWidget::languageChange() { } // compat \endcode */ -/*! - \fn QColorGroup QWidget::colorGroup() const - - Use QColorGroup(palette()) instead. -*/ /*! \fn QWidget *QWidget::parentWidget(bool sameWindow) const diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h index 7186c441f6..d3a08a86c7 100644 --- a/src/gui/kernel/qwidget.h +++ b/src/gui/kernel/qwidget.h @@ -855,7 +855,6 @@ public: const QT3_SUPPORT QPixmap *backgroundPixmap() const; void QT3_SUPPORT setBackgroundPixmap(const QPixmap &); QT3_SUPPORT void setBackgroundColor(const QColor &); - QT3_SUPPORT QColorGroup colorGroup() const; QT3_SUPPORT QWidget *parentWidget(bool sameWindow) const; inline QT3_SUPPORT void setKeyCompression(bool b) { setAttribute(Qt::WA_KeyCompression, b); } inline QT3_SUPPORT void setFont(const QFont &f, bool) { setFont(f); } @@ -1052,8 +1051,6 @@ inline QWidget *QWidget::parentWidget(bool sameWindow) const return 0; return static_cast(QObject::parent()); } -inline QColorGroup QWidget::colorGroup() const -{ return QColorGroup(palette()); } inline void QWidget::setPaletteForegroundColor(const QColor &c) { QPalette p = palette(); p.setColor(foregroundRole(), c); setPalette(p); } inline const QBrush& QWidget::backgroundBrush() const { return palette().brush(backgroundRole()); } diff --git a/src/gui/kernel/qwindowdefs.h b/src/gui/kernel/qwindowdefs.h index ab8af5fbb2..dd6d13a338 100644 --- a/src/gui/kernel/qwindowdefs.h +++ b/src/gui/kernel/qwindowdefs.h @@ -57,9 +57,6 @@ class QWidget; class QDialog; class QColor; class QPalette; -#ifdef QT3_SUPPORT -class QColorGroup; -#endif class QCursor; class QPoint; class QSize; -- cgit v1.2.3