summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qaction.cpp59
-rw-r--r--src/widgets/kernel/qaction.h30
-rw-r--r--src/widgets/kernel/qaction_p.h7
-rw-r--r--src/widgets/kernel/qactiongroup.h6
-rw-r--r--src/widgets/kernel/qapplication.cpp34
-rw-r--r--src/widgets/kernel/qapplication.h47
-rw-r--r--src/widgets/kernel/qapplication_p.h20
-rw-r--r--src/widgets/kernel/qapplication_qpa.cpp9
-rw-r--r--src/widgets/kernel/qboxlayout.cpp170
-rw-r--r--src/widgets/kernel/qboxlayout.h24
-rw-r--r--src/widgets/kernel/qgridlayout.cpp104
-rw-r--r--src/widgets/kernel/qgridlayout.h38
-rw-r--r--src/widgets/kernel/qlayout.cpp174
-rw-r--r--src/widgets/kernel/qlayout.h58
-rw-r--r--src/widgets/kernel/qsizepolicy.h45
-rw-r--r--src/widgets/kernel/qtooltip.h6
-rw-r--r--src/widgets/kernel/qwhatsthis.cpp67
-rw-r--r--src/widgets/kernel/qwhatsthis.h8
-rw-r--r--src/widgets/kernel/qwidget.cpp342
-rw-r--r--src/widgets/kernel/qwidget.h135
20 files changed, 0 insertions, 1383 deletions
diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp
index 5b73a4ba7e..a65869a903 100644
--- a/src/widgets/kernel/qaction.cpp
+++ b/src/widgets/kernel/qaction.cpp
@@ -86,11 +86,6 @@ QActionPrivate::QActionPrivate() : group(0), enabled(1), forceDisabled(0),
menuRole(QAction::TextHeuristicRole), softKeyRole(QAction::NoSoftKey),
priority(QAction::NormalPriority)
{
-#ifdef QT3_SUPPORT
- static int qt_static_action_id = -1;
- param = id = --qt_static_action_id;
- act_signal = 0;
-#endif
#ifndef QT_NO_SHORTCUT
shortcutId = 0;
shortcutContext = Qt::WindowShortcut;
@@ -595,56 +590,6 @@ QFont QAction::font() const
return d->font;
}
-#ifdef QT3_SUPPORT
-/*!
- Use one of the QAction constructors that doesn't take a \a name
- argument and call setObjectName() instead.
-*/
-QAction::QAction(QObject* parent, const char* name)
- : QObject(*(new QActionPrivate), parent)
-{
- Q_D(QAction);
- setObjectName(QString::fromAscii(name));
- d->group = qobject_cast<QActionGroup *>(parent);
- if (d->group)
- d->group->addAction(this);
-}
-
-
-/*!
- Use one of the QAction constructors that doesn't take a \a name
- argument and call setObjectName() instead.
-*/
-QAction::QAction(const QString &text, const QKeySequence &shortcut, QObject* parent, const char* name)
- : QObject(*(new QActionPrivate), parent)
-{
- Q_D(QAction);
- setObjectName(QString::fromAscii(name));
- d->text = text;
- setShortcut(shortcut);
- d->group = qobject_cast<QActionGroup *>(parent);
- if (d->group)
- d->group->addAction(this);
-}
-
-/*!
- Use one of the QAction constructors that doesn't take a \a name
- argument and call setObjectName() instead.
-*/
-QAction::QAction(const QIcon &icon, const QString &text, const QKeySequence &shortcut,
- QObject* parent, const char* name)
- : QObject(*(new QActionPrivate), parent)
-{
- Q_D(QAction);
- setObjectName(QString::fromAscii(name));
- d->text = text;
- setShortcut(shortcut);
- d->icon = icon;
- d->group = qobject_cast<QActionGroup *>(parent);
- if (d->group)
- d->group->addAction(this);
-}
-#endif
/*!
Destroys the object and frees allocated resources.
@@ -1255,10 +1200,6 @@ void QAction::activate(ActionEvent event)
}
if (guard)
emit triggered(d->checked);
-#ifdef QT3_SUPPORT
- if (guard)
- emit activated(d->param);
-#endif
QMetaObject::removeGuard(&guard);
} else if(event == Hover) {
emit hovered();
diff --git a/src/widgets/kernel/qaction.h b/src/widgets/kernel/qaction.h
index da8c24e184..193328dbdd 100644
--- a/src/widgets/kernel/qaction.h
+++ b/src/widgets/kernel/qaction.h
@@ -102,14 +102,6 @@ public:
QAction(const QString &text, QObject* parent);
QAction(const QIcon &icon, const QString &text, QObject* parent);
-#ifdef QT3_SUPPORT
- QT3_SUPPORT_CONSTRUCTOR QAction(QObject* parent, const char* name);
- QT3_SUPPORT_CONSTRUCTOR QAction(const QString &text, const QKeySequence &shortcut,
- QObject* parent, const char* name);
- QT3_SUPPORT_CONSTRUCTOR QAction(const QIcon &icon, const QString &text,
- const QKeySequence &shortcut,
- QObject* parent, const char* name);
-#endif
~QAction();
void setActionGroup(QActionGroup *group);
@@ -186,19 +178,6 @@ public:
void setIconVisibleInMenu(bool visible);
bool isIconVisibleInMenu() const;
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT void setMenuText(const QString &text) { setText(text); }
- inline QT3_SUPPORT QString menuText() const { return text(); }
- inline QT3_SUPPORT bool isOn() const { return isChecked(); }
- inline QT3_SUPPORT bool isToggleAction() const { return isCheckable(); }
- inline QT3_SUPPORT void setToggleAction(bool b) { setCheckable(b); }
- inline QT3_SUPPORT void setIconSet(const QIcon &i) { setIcon(i); }
- inline QT3_SUPPORT QIcon iconSet() const { return icon(); }
- inline QT3_SUPPORT bool addTo(QWidget *w) { w->addAction(this); return true; }
- inline QT3_SUPPORT bool removeFrom(QWidget *w) { w->removeAction(this); return true; }
- inline QT3_SUPPORT void setAccel(const QKeySequence &shortcut) { setShortcut(shortcut); }
- inline QT3_SUPPORT QKeySequence accel() const { return shortcut(); }
-#endif
QWidget *parentWidget() const;
@@ -212,9 +191,6 @@ protected:
QAction(QActionPrivate &dd, QObject *parent);
public Q_SLOTS:
-#ifdef QT3_SUPPORT
- inline QT_MOC_COMPAT void setOn(bool b) { setChecked(b); }
-#endif
void trigger() { activate(Trigger); }
void hover() { activate(Hover); }
void setChecked(bool);
@@ -228,16 +204,10 @@ Q_SIGNALS:
void triggered(bool checked = false);
void hovered();
void toggled(bool);
-#ifdef QT3_SUPPORT
- QT_MOC_COMPAT void activated(int = 0);
-#endif
private:
Q_DISABLE_COPY(QAction)
-#ifdef QT3_SUPPORT
- friend class QMenuItem;
-#endif
friend class QGraphicsWidget;
friend class QWidget;
friend class QActionGroup;
diff --git a/src/widgets/kernel/qaction_p.h b/src/widgets/kernel/qaction_p.h
index 6714f2a65c..8f9e1f0f8e 100644
--- a/src/widgets/kernel/qaction_p.h
+++ b/src/widgets/kernel/qaction_p.h
@@ -62,9 +62,6 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACTION
-#ifdef QT3_SUPPORT
-class QMenuItemEmitter;
-#endif
class QShortcutMap;
@@ -130,10 +127,6 @@ public:
static QShortcutMap *globalMap;
#endif // QT_NO_SHORTCUT
-#ifdef QT3_SUPPORT //for menubar/menu compat
- QMenuItemEmitter *act_signal;
- int id, param;
-#endif
void sendDataChanged();
};
diff --git a/src/widgets/kernel/qactiongroup.h b/src/widgets/kernel/qactiongroup.h
index deeed061cd..d8a95fcde4 100644
--- a/src/widgets/kernel/qactiongroup.h
+++ b/src/widgets/kernel/qactiongroup.h
@@ -78,12 +78,6 @@ public:
bool isEnabled() const;
bool isVisible() const;
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT void add(QAction* a) { addAction(a); }
- inline QT3_SUPPORT void addSeparator()
- { QAction *act = new QAction(this); act->setSeparator(true); addAction(act); }
- inline QT3_SUPPORT bool addTo(QWidget *w) { w->addActions(actions()); return true; }
-#endif
public Q_SLOTS:
void setEnabled(bool);
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 83a3468ed6..80223743b1 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -176,13 +176,6 @@ QApplicationPrivate::QApplicationPrivate(int &argc, char **argv, QApplication::T
quitOnLastWindowClosed = true;
-#ifdef QT3_SUPPORT
- qt_compat_used = 0;
- qt_compat_resolved = 0;
- qt_tryAccelEvent = 0;
- qt_tryComposeUnicode = 0;
- qt_dispatchAccelEvent = 0;
-#endif
#if defined(Q_WS_QWS) && !defined(QT_NO_DIRECTPAINTER)
directPainters = 0;
#endif
@@ -1195,9 +1188,6 @@ QWidget *QApplication::widgetAt(const QPoint &p)
bool QApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventList *postedEvents)
{
if ((event->type() == QEvent::UpdateRequest
-#ifdef QT3_SUPPORT
- || event->type() == QEvent::LayoutHint
-#endif
|| event->type() == QEvent::LayoutRequest
|| event->type() == QEvent::Resize
|| event->type() == QEvent::Move
@@ -1209,9 +1199,6 @@ bool QApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventLis
if (cur.receiver != receiver || cur.event == 0 || cur.event->type() != event->type())
continue;
if (cur.event->type() == QEvent::LayoutRequest
-#ifdef QT3_SUPPORT
- || cur.event->type() == QEvent::LayoutHint
-#endif
|| cur.event->type() == QEvent::UpdateRequest) {
;
} else if (cur.event->type() == QEvent::Resize) {
@@ -1488,10 +1475,6 @@ void QApplication::setStyle(QStyle *style)
if (w->windowType() != Qt::Desktop && !w->testAttribute(Qt::WA_SetStyle)) {
QEvent e(QEvent::StyleChange);
QApplication::sendEvent(w, &e);
-#ifdef QT3_SUPPORT
- if (old)
- w->styleChange(*old);
-#endif
w->update();
}
}
@@ -3478,12 +3461,6 @@ int QApplication::startDragDistance()
language used.
*/
-#ifdef QT3_SUPPORT
-Qt::Alignment QApplication::horizontalAlignment(Qt::Alignment align)
-{
- return QGuiApplicationPrivate::visualAlignment(layoutDirection(), align);
-}
-#endif
/*!
Enters the main event loop and waits until exit() is called, then returns
@@ -3582,11 +3559,6 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
case QEvent::DragEnter: case QEvent::DragMove: case QEvent::DragLeave:
case QEvent::Drop: case QEvent::DragResponse:
case QEvent::ChildAdded: case QEvent::ChildPolished:
-#ifdef QT3_SUPPORT
- case QEvent::ChildInsertedRequest:
- case QEvent::ChildInserted:
- case QEvent::LayoutHint:
-#endif
case QEvent::ChildRemoved:
case QEvent::UpdateRequest:
case QEvent::UpdateLater:
@@ -4798,12 +4770,6 @@ void QSessionManager::requestPhase2()
\snippet doc/src/snippets/code/src_gui_kernel_qapplication.cpp 13
*/
-#ifdef QT3_SUPPORT
-QWidget *QApplication::mainWidget()
-{
- return QApplicationPrivate::main_widget;
-}
-#endif
bool QApplicationPrivate::inPopupMode() const
{
return QApplicationPrivate::popupWidgets != 0;
diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h
index aec2c07763..8fd988f7a8 100644
--- a/src/widgets/kernel/qapplication.h
+++ b/src/widgets/kernel/qapplication.h
@@ -50,10 +50,6 @@
#ifdef QT_INCLUDE_COMPAT
# include <QtWidgets/qdesktopwidget.h>
#endif
-#ifdef QT3_SUPPORT
-# include <QtWidgets/qwidget.h>
-# include <QtGui/qpalette.h>
-#endif
#ifdef Q_WS_QWS
# include <QtGui/qrgb.h>
# include <QtGui/qtransportauth_qws.h>
@@ -170,10 +166,6 @@ public:
static QIcon windowIcon();
-#ifdef QT3_SUPPORT
- static QT3_SUPPORT QWidget *mainWidget();
- static QT3_SUPPORT void setMainWidget(QWidget *);
-#endif
static QWidgetList allWidgets();
static QWidgetList topLevelWidgets();
@@ -320,45 +312,6 @@ protected:
bool event(QEvent *);
bool compressEvent(QEvent *, QObject *receiver, QPostEventList *);
-#ifdef QT3_SUPPORT
-public:
- static inline QT3_SUPPORT void setReverseLayout(bool b) { setLayoutDirection(b?Qt::RightToLeft:Qt::LeftToRight); }
- static inline bool QT3_SUPPORT reverseLayout() { return layoutDirection() == Qt::RightToLeft; }
- static QT3_SUPPORT Qt::Alignment horizontalAlignment(Qt::Alignment align);
- typedef int ColorMode;
- enum { NormalColors = NormalColor, CustomColors = CustomColor };
- static inline QT3_SUPPORT ColorMode colorMode() { return static_cast<ColorMode>(colorSpec()); }
- static inline QT3_SUPPORT void setColorMode(ColorMode mode) { setColorSpec(int(mode)); }
-#if defined(Q_OS_WIN32) || defined(Q_OS_CYGWIN)
- static QT3_SUPPORT Qt::WindowsVersion winVersion() { return (Qt::WindowsVersion)QSysInfo::WindowsVersion; }
-#endif
-#if defined(Q_OS_MAC)
- static QT3_SUPPORT Qt::MacintoshVersion macVersion() { return (Qt::MacintoshVersion)QSysInfo::MacintoshVersion; }
-#endif
-# ifndef QT_NO_CURSOR
- inline static QT3_SUPPORT void setOverrideCursor(const QCursor &cursor, bool replace)
- { if (replace) changeOverrideCursor(cursor); else setOverrideCursor(cursor); }
-# endif
- inline static QT3_SUPPORT bool hasGlobalMouseTracking() {return true;}
- inline static QT3_SUPPORT void setGlobalMouseTracking(bool) {}
- inline static QT3_SUPPORT void flushX() { flush(); }
- static inline QT3_SUPPORT void setWinStyleHighlightColor(const QColor &c) {
- QPalette p(palette());
- p.setColor(QPalette::Highlight, c);
- setPalette(p);
- }
- static inline QT3_SUPPORT const QColor &winStyleHighlightColor()
- { return palette().color(QPalette::Active, QPalette::Highlight); }
- static inline QT3_SUPPORT void setPalette(const QPalette &pal, bool, const char* className = 0)
- { setPalette(pal, className); }
- static inline QT3_SUPPORT void setFont(const QFont &font, bool, const char* className = 0)
- { setFont(font, className); }
-
- static inline QT3_SUPPORT QWidget *widgetAt(int x, int y, bool child)
- { QWidget *w = widgetAt(x, y); return child ? w : (w ? w->window() : 0); }
- static inline QT3_SUPPORT QWidget *widgetAt(const QPoint &p, bool child)
- { QWidget *w = widgetAt(p); return child ? w : (w ? w->window() : 0); }
-#endif // QT3_SUPPORT
#if defined(Q_INTERNAL_QAPP_SRC) || defined(qdoc)
QApplication(int &argc, char **argv);
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h
index e466528cfb..e451a53b6c 100644
--- a/src/widgets/kernel/qapplication_p.h
+++ b/src/widgets/kernel/qapplication_p.h
@@ -195,13 +195,6 @@ QMacTabletHash *qt_mac_tablet_hash();
# endif
#endif
-#ifdef QT3_SUPPORT
-extern "C" {
- typedef bool (*Ptrqt_tryAccelEvent)(QWidget *w, QKeyEvent *e);
- typedef bool (*Ptrqt_tryComposeUnicode)(QWidget *w, QKeyEvent *e);
- typedef bool (*Ptrqt_dispatchAccelEvent)(QWidget *w, QKeyEvent *e);
-}
-#endif
#if defined(Q_WS_WIN)
typedef BOOL (WINAPI *PtrRegisterTouchWindow)(HWND, ULONG);
@@ -387,19 +380,6 @@ public:
QShortcutMap shortcutMap;
#endif
-#ifdef QT3_SUPPORT
- bool qt_compat_used;
- bool qt_compat_resolved;
- Ptrqt_tryAccelEvent qt_tryAccelEvent;
- Ptrqt_tryComposeUnicode qt_tryComposeUnicode;
- Ptrqt_dispatchAccelEvent qt_dispatchAccelEvent;
-
- bool use_compat() {
- return qt_tryAccelEvent
- && qt_tryComposeUnicode
- && qt_dispatchAccelEvent;
- }
-#endif
static QInputContext *inputContext;
static Qt::MouseButtons mouse_buttons;
diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp
index 179aced62f..29ac94bfb1 100644
--- a/src/widgets/kernel/qapplication_qpa.cpp
+++ b/src/widgets/kernel/qapplication_qpa.cpp
@@ -425,14 +425,5 @@ void qt_cleanup()
#endif
}
-#ifdef QT3_SUPPORT
-void QApplication::setMainWidget(QWidget *mainWidget)
-{
- QApplicationPrivate::main_widget = mainWidget;
- if (QApplicationPrivate::main_widget && windowIcon().isNull()
- && QApplicationPrivate::main_widget->testAttribute(Qt::WA_SetWindowIcon))
- setWindowIcon(QApplicationPrivate::main_widget->windowIcon());
-}
-#endif
QT_END_NAMESPACE
diff --git a/src/widgets/kernel/qboxlayout.cpp b/src/widgets/kernel/qboxlayout.cpp
index da353dcc01..dd69f3a7be 100644
--- a/src/widgets/kernel/qboxlayout.cpp
+++ b/src/widgets/kernel/qboxlayout.cpp
@@ -556,66 +556,6 @@ QBoxLayout::QBoxLayout(Direction dir, QWidget *parent)
d->dir = dir;
}
-#ifdef QT3_SUPPORT
-/*!
- Constructs a new QBoxLayout with direction \a dir and main widget \a
- parent. \a parent may not be 0.
-
- The \a margin is the number of pixels between the edge of the
- widget and its managed children. The \a spacing is the default
- number of pixels between neighboring children. If \a spacing is -1
- the value of \a margin is used for \a spacing.
-
- \a name is the internal object name.
-
- \sa direction()
-*/
-QBoxLayout::QBoxLayout(QWidget *parent, Direction dir,
- int margin, int spacing, const char *name)
- : QLayout(*new QBoxLayoutPrivate, 0, parent)
-{
- Q_D(QBoxLayout);
- d->dir = dir;
- setMargin(margin);
- setObjectName(QString::fromAscii(name));
- setSpacing(spacing<0 ? margin : spacing);
-}
-
-/*!
- Constructs a new QBoxLayout called \a name, with direction \a dir,
- and inserts it into \a parentLayout.
-
- The \a spacing is the default number of pixels between neighboring
- children. If \a spacing is -1, the layout will inherit its
- parent's spacing().
-*/
-QBoxLayout::QBoxLayout(QLayout *parentLayout, Direction dir, int spacing,
- const char *name)
- : QLayout(*new QBoxLayoutPrivate, parentLayout, 0)
-{
- Q_D(QBoxLayout);
- d->dir = dir;
- setObjectName(QString::fromAscii(name));
- setSpacing(spacing);
-}
-
-/*!
- Constructs a new QBoxLayout called \a name, with direction \a dir.
-
- If \a spacing is -1, the layout will inherit its parent's
- spacing(); otherwise \a spacing is used.
-
- You must insert this box into another layout.
-*/
-QBoxLayout::QBoxLayout(Direction dir, int spacing, const char *name)
- : QLayout(*new QBoxLayoutPrivate,0, 0)
-{
- Q_D(QBoxLayout);
- d->dir = dir;
- setObjectName(QString::fromAscii(name));
- setSpacing(spacing);
-}
-#endif // QT3_SUPPORT
/*!
@@ -1337,60 +1277,6 @@ QHBoxLayout::QHBoxLayout()
-#ifdef QT3_SUPPORT
-/*!
- Constructs a new top-level horizontal box called \a name, with
- parent \a parent.
-
- The \a margin is the number of pixels between the edge of the
- widget and its managed children. The \a spacing is the default
- number of pixels between neighboring children. If \a spacing is -1
- the value of \a margin is used for \a spacing.
-*/
-QHBoxLayout::QHBoxLayout(QWidget *parent, int margin,
- int spacing, const char *name)
- : QBoxLayout(LeftToRight, parent)
-{
- setMargin(margin);
- setSpacing(spacing<0 ? margin : spacing);
- setObjectName(QString::fromAscii(name));
-}
-
-/*!
- Constructs a new horizontal box called name \a name and adds it to
- \a parentLayout.
-
- The \a spacing is the default number of pixels between neighboring
- children. If \a spacing is -1, this QHBoxLayout will inherit its
- parent's spacing().
-*/
-QHBoxLayout::QHBoxLayout(QLayout *parentLayout, int spacing,
- const char *name)
- : QBoxLayout(LeftToRight)
-{
- setSpacing(spacing);
- setObjectName(QString::fromAscii(name));
- if (parentLayout) {
- setParent(parentLayout);
- parentLayout->addItem(this);
- }
-}
-
-/*!
- Constructs a new horizontal box called name \a name. You must add
- it to another layout.
-
- The \a spacing is the default number of pixels between neighboring
- children. If \a spacing is -1, this QHBoxLayout will inherit its
- parent's spacing().
-*/
-QHBoxLayout::QHBoxLayout(int spacing, const char *name)
- : QBoxLayout(LeftToRight)
-{
- setSpacing(spacing);
- setObjectName(QString::fromAscii(name));
-}
-#endif
/*!
@@ -1451,62 +1337,6 @@ QVBoxLayout::QVBoxLayout()
{
}
-#ifdef QT3_SUPPORT
-/*!
- Constructs a new top-level vertical box called \a name, with
- parent \a parent.
-
- The \a margin is the number of pixels between the edge of the
- widget and its managed children. The \a spacing is the default
- number of pixels between neighboring children. If \a spacing is -1
- the value of \a margin is used for \a spacing.
-*/
-QVBoxLayout::QVBoxLayout(QWidget *parent, int margin, int spacing,
- const char *name)
- : QBoxLayout(TopToBottom, parent)
-{
- setMargin(margin);
- setSpacing(spacing<0 ? margin : spacing);
- setObjectName(QString::fromAscii(name));
-}
-
-/*!
- Constructs a new vertical box called name \a name and adds it to
- \a parentLayout.
-
- The \a spacing is the default number of pixels between neighboring
- children. If \a spacing is -1, this QVBoxLayout will inherit its
- parent's spacing().
-*/
-QVBoxLayout::QVBoxLayout(QLayout *parentLayout, int spacing,
- const char *name)
- : QBoxLayout(TopToBottom)
-{
- setSpacing(spacing);
- setObjectName(QString::fromAscii(name));
- if (parentLayout) {
- setParent(parentLayout);
- parentLayout->addItem(this);
- }
-}
-
-/*!
- Constructs a new vertical box called name \a name. You must add
- it to another layout.
-
- The \a spacing is the default number of pixels between neighboring
- children. If \a spacing is -1, this QVBoxLayout will inherit its
- parent's spacing().
-*/
-QVBoxLayout::QVBoxLayout(int spacing, const char *name)
- : QBoxLayout(TopToBottom)
-{
- setSpacing(spacing);
- setObjectName(QString::fromAscii(name));
-}
-
-
-#endif
/*!
Destroys this box layout.
diff --git a/src/widgets/kernel/qboxlayout.h b/src/widgets/kernel/qboxlayout.h
index 7c56a32979..5031972226 100644
--- a/src/widgets/kernel/qboxlayout.h
+++ b/src/widgets/kernel/qboxlayout.h
@@ -67,13 +67,6 @@ public:
explicit QBoxLayout(Direction, QWidget *parent = 0);
-#ifdef QT3_SUPPORT
- QT3_SUPPORT_CONSTRUCTOR QBoxLayout(QWidget *parent, Direction, int border = 0, int spacing = -1,
- const char *name = 0);
- QT3_SUPPORT_CONSTRUCTOR QBoxLayout(QLayout *parentLayout, Direction, int spacing = -1,
- const char *name = 0);
- QT3_SUPPORT_CONSTRUCTOR QBoxLayout(Direction, int spacing, const char *name = 0);
-#endif
~QBoxLayout();
Direction direction() const;
@@ -115,9 +108,6 @@ public:
QLayoutItem *takeAt(int);
int count() const;
void setGeometry(const QRect&);
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT int findWidget(QWidget* w) {return indexOf(w);}
-#endif
protected:
// ### Qt 5: make public
void insertItem(int index, QLayoutItem *);
@@ -134,13 +124,6 @@ public:
explicit QHBoxLayout(QWidget *parent);
~QHBoxLayout();
-#ifdef QT3_SUPPORT
- QT3_SUPPORT_CONSTRUCTOR QHBoxLayout(QWidget *parent, int border,
- int spacing = -1, const char *name = 0);
- QT3_SUPPORT_CONSTRUCTOR QHBoxLayout(QLayout *parentLayout,
- int spacing = -1, const char *name = 0);
- QT3_SUPPORT_CONSTRUCTOR QHBoxLayout(int spacing, const char *name = 0);
-#endif
private:
Q_DISABLE_COPY(QHBoxLayout)
@@ -154,13 +137,6 @@ public:
explicit QVBoxLayout(QWidget *parent);
~QVBoxLayout();
-#ifdef QT3_SUPPORT
- QT3_SUPPORT_CONSTRUCTOR QVBoxLayout(QWidget *parent, int border,
- int spacing = -1, const char *name = 0);
- QT3_SUPPORT_CONSTRUCTOR QVBoxLayout(QLayout *parentLayout,
- int spacing = -1, const char *name = 0);
- QT3_SUPPORT_CONSTRUCTOR QVBoxLayout(int spacing, const char *name = 0);
-#endif
private:
Q_DISABLE_COPY(QVBoxLayout)
diff --git a/src/widgets/kernel/qgridlayout.cpp b/src/widgets/kernel/qgridlayout.cpp
index c237136480..3fafb62444 100644
--- a/src/widgets/kernel/qgridlayout.cpp
+++ b/src/widgets/kernel/qgridlayout.cpp
@@ -1076,71 +1076,6 @@ QGridLayout::QGridLayout()
}
-#ifdef QT3_SUPPORT
-/*!
- \obsolete
- Constructs a new QGridLayout with \a nRows rows, \a nCols columns
- and parent widget, \a parent. \a parent may not be 0. The grid
- layout is called \a name.
-
- \a margin is the number of pixels between the edge of the widget
- and its managed children. \a space is the default number of pixels
- between cells. If \a space is -1, the value of \a margin is used.
-*/
-QGridLayout::QGridLayout(QWidget *parent, int nRows, int nCols, int margin,
- int space, const char *name)
- : QLayout(*new QGridLayoutPrivate, 0, parent)
-{
- Q_D(QGridLayout);
- d->expand(nRows, nCols);
- setMargin(margin);
- setSpacing(space < 0 ? margin : space);
- setObjectName(QString::fromAscii(name));
-}
-
-/*!
- \obsolete
-
- Constructs a new grid with \a nRows rows and \a nCols columns. If
- \a spacing is -1, this QGridLayout inherits its parent's
- spacing(); otherwise \a spacing is used. The grid layout is called
- \a name.
-
- You must insert this grid into another layout. You can insert
- widgets and layouts into this layout at any time, but laying out
- will not be performed before this is inserted into another layout.
-*/
-QGridLayout::QGridLayout(QLayout *parentLayout, int nRows, int nCols,
- int spacing, const char *name)
- : QLayout(*new QGridLayoutPrivate, parentLayout, 0)
-{
- Q_D(QGridLayout);
- d->expand(nRows, nCols);
- setSpacing(spacing);
- setObjectName(QString::fromAscii(name));
-}
-
-/*!
- \obsolete
-
- Constructs a new grid with \a nRows rows and \a nCols columns. If
- \a spacing is -1, this QGridLayout inherits its parent's
- spacing(); otherwise \a spacing is used. The grid layout is called
- \a name.
-
- You must insert this grid into another layout. You can insert
- widgets and layouts into this layout at any time, but laying out
- will not be performed before this is inserted into another layout.
-*/
-QGridLayout::QGridLayout(int nRows, int nCols, int spacing, const char *name)
- : QLayout(*new QGridLayoutPrivate, 0, 0)
-{
- Q_D(QGridLayout);
- d->expand(nRows, nCols);
- setSpacing(spacing);
- setObjectName(QString::fromAscii(name));
-}
-#endif
/*!
@@ -1353,31 +1288,6 @@ int QGridLayout::minimumHeightForWidth(int w) const
return dat->minimumHeightForWidth(w, horizontalSpacing(), verticalSpacing());
}
-#ifdef QT3_SUPPORT
-/*!
- \compat
-
- Searches for widget \a w in this layout (not including child
- layouts). If \a w is found, it sets \c{*}\a{row} and
- \c{*}\a{column} to the row and column that the widget
- occupies and returns true; otherwise returns false.
-
- If the widget spans multiple rows/columns, the top-left cell
- is returned.
-
- Use indexOf() and getItemPosition() instead.
-*/
-bool QGridLayout::findWidget(QWidget* w, int *row, int *column)
-{
- Q_D(QGridLayout);
- int index = indexOf(w);
- if (index < 0)
- return false;
- int dummy1, dummy2;
- d->getItemPosition(index, row, column, &dummy1, &dummy2);
- return true;
-}
-#endif
/*!
\reimp
*/
@@ -1471,20 +1381,6 @@ QRect QGridLayout::cellRect(int row, int column) const
Q_D(const QGridLayout);
return d->cellRect(row, column);
}
-#ifdef QT3_SUPPORT
-/*!
- \obsolete
- Expands this grid so that it will have \a nRows rows and \a nCols
- columns. Will not shrink the grid. You should not need to call
- this function because QGridLayout expands automatically as new
- items are inserted.
-*/
-void QGridLayout::expand(int nRows, int nCols)
-{
- Q_D(QGridLayout);
- d->expand(nRows, nCols);
-}
-#endif
/*!
\reimp
diff --git a/src/widgets/kernel/qgridlayout.h b/src/widgets/kernel/qgridlayout.h
index 3e579e3dfd..ef95d29cd1 100644
--- a/src/widgets/kernel/qgridlayout.h
+++ b/src/widgets/kernel/qgridlayout.h
@@ -68,13 +68,6 @@ public:
explicit QGridLayout(QWidget *parent);
QGridLayout();
-#ifdef QT3_SUPPORT
- QT3_SUPPORT_CONSTRUCTOR QGridLayout(QWidget *parent, int nRows , int nCols = 1, int border = 0,
- int spacing = -1, const char *name = 0);
- QT3_SUPPORT_CONSTRUCTOR QGridLayout(int nRows , int nCols = 1, int spacing = -1, const char *name = 0);
- QT3_SUPPORT_CONSTRUCTOR QGridLayout(QLayout *parentLayout, int nRows = 1, int nCols = 1, int spacing = -1,
- const char *name = 0);
-#endif
~QGridLayout();
QSize sizeHint() const;
@@ -102,9 +95,6 @@ public:
int rowCount() const;
QRect cellRect(int row, int column) const;
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT QRect cellGeometry(int row, int column) const {return cellRect(row, column);}
-#endif
bool hasHeightForWidth() const;
int heightForWidth(int) const;
@@ -122,10 +112,6 @@ public:
void setOriginCorner(Qt::Corner);
Qt::Corner originCorner() const;
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT void setOrigin(Qt::Corner corner) { setOriginCorner(corner); }
- inline QT3_SUPPORT Qt::Corner origin() const { return originCorner(); }
-#endif
QLayoutItem *itemAt(int index) const;
QLayoutItem *itemAtPosition(int row, int column) const;
QLayoutItem *takeAt(int index);
@@ -138,35 +124,11 @@ public:
void getItemPosition(int idx, int *row, int *column, int *rowSpan, int *columnSpan);
protected:
-#ifdef QT3_SUPPORT
- QT3_SUPPORT bool findWidget(QWidget* w, int *r, int *c);
-#endif
void addItem(QLayoutItem *);
private:
Q_DISABLE_COPY(QGridLayout)
-#ifdef QT3_SUPPORT
-public:
- QT3_SUPPORT void expand(int rows, int cols);
- inline QT3_SUPPORT void addRowSpacing(int row, int minsize) { addItem(new QSpacerItem(0,minsize), row, 0); }
- inline QT3_SUPPORT void addColSpacing(int col, int minsize) { addItem(new QSpacerItem(minsize,0), 0, col); }
- inline QT3_SUPPORT void addMultiCellWidget(QWidget *w, int fromRow, int toRow, int fromCol, int toCol, Qt::Alignment _align = 0)
- { addWidget(w, fromRow, fromCol, (toRow < 0) ? -1 : toRow - fromRow + 1, (toCol < 0) ? -1 : toCol - fromCol + 1, _align); }
- inline QT3_SUPPORT void addMultiCell(QLayoutItem *l, int fromRow, int toRow, int fromCol, int toCol, Qt::Alignment _align = 0)
- { addItem(l, fromRow, fromCol, (toRow < 0) ? -1 : toRow - fromRow + 1, (toCol < 0) ? -1 : toCol - fromCol + 1, _align); }
- inline QT3_SUPPORT void addMultiCellLayout(QLayout *layout, int fromRow, int toRow, int fromCol, int toCol, Qt::Alignment _align = 0)
- { addLayout(layout, fromRow, fromCol, (toRow < 0) ? -1 : toRow - fromRow + 1, (toCol < 0) ? -1 : toCol - fromCol + 1, _align); }
-
- inline QT3_SUPPORT int numRows() const { return rowCount(); }
- inline QT3_SUPPORT int numCols() const { return columnCount(); }
- inline QT3_SUPPORT void setColStretch(int col, int stretch) {setColumnStretch(col, stretch); }
- inline QT3_SUPPORT int colStretch(int col) const {return columnStretch(col); }
- inline QT3_SUPPORT void setColSpacing(int col, int minSize) { setColumnMinimumWidth(col, minSize); }
- inline QT3_SUPPORT int colSpacing(int col) const { return columnMinimumWidth(col); }
- inline QT3_SUPPORT void setRowSpacing(int row, int minSize) {setRowMinimumHeight(row, minSize); }
- inline QT3_SUPPORT int rowSpacing(int row) const {return rowMinimumHeight(row); }
-#endif
};
QT_END_NAMESPACE
diff --git a/src/widgets/kernel/qlayout.cpp b/src/widgets/kernel/qlayout.cpp
index 68cd1183d6..68c1dd9c67 100644
--- a/src/widgets/kernel/qlayout.cpp
+++ b/src/widgets/kernel/qlayout.cpp
@@ -202,97 +202,6 @@ QSpacerItem *QLayoutPrivate::createSpacerItem(const QLayout *layout, int w, int
return new QSpacerItem(w, h, hPolicy, vPolicy);
}
-#ifdef QT3_SUPPORT
-/*!
- Constructs a new top-level QLayout called \a name, with parent
- widget \a parent. \a parent may not be 0.
-
- The \a margin is the number of pixels between the edge of the
- widget and the managed children. The \a spacing sets the value of
- spacing(), which gives the spacing between the managed widgets. If
- \a spacing is -1 (the default), spacing is set to the value of \a
- margin.
-
- There can be only one top-level layout for a widget. It is
- returned by QWidget::layout()
-
- \sa QWidget::setLayout()
-*/
-QLayout::QLayout(QWidget *parent, int margin, int spacing, const char *name)
- : QObject(*new QLayoutPrivate,parent)
-{
- Q_D(QLayout);
- setObjectName(QString::fromAscii(name));
- setMargin(margin);
- if (spacing < 0)
- d->insideSpacing = margin;
- else
- d->insideSpacing = spacing;
- if (parent) {
- if (parent->layout()) {
- qWarning("QLayout \"%s\" added to %s \"%s\", which already has a layout",
- QObject::objectName().toLocal8Bit().data(), parent->metaObject()->className(),
- parent->objectName().toLocal8Bit().data());
- parent->layout()->setParent(0);
- } else {
- d->topLevel = true;
- parent->d_func()->layout = this;
- QT_TRY {
- invalidate();
- } QT_CATCH(...) {
- parent->d_func()->layout = 0;
- QT_RETHROW;
- }
- }
- }
-}
-
-/*!
- Constructs a new child QLayout called \a name, and places it
- inside \a parentLayout by using the default placement defined by
- addItem().
-
- If \a spacing is -1, this QLayout inherits \a parentLayout's
- spacing(), otherwise the value of \a spacing is used.
-*/
-QLayout::QLayout(QLayout *parentLayout, int spacing, const char *name)
- : QObject(*new QLayoutPrivate,parentLayout)
-
-{
- Q_D(QLayout);
- setObjectName(QString::fromAscii(name));
- d->insideSpacing = spacing;
- parentLayout->addItem(this);
-}
-
-/*!
- Constructs a new child QLayout called \a name. If \a spacing is
- -1, this QLayout inherits its parent's spacing(); otherwise the
- value of \a spacing is used.
-
- This layout has to be inserted into another layout before geometry
- management will work.
-*/
-QLayout::QLayout(int spacing, const char *name)
- : QObject(*new QLayoutPrivate, 0)
-{
- Q_D(QLayout);
- setObjectName(QString::fromAscii(name));
- d->insideSpacing = spacing;
-}
-
-/*!
- Automatically adding widgets is deprecated. Use addWidget() or
- addLayout() instead.
-*/
-void QLayout::setAutoAdd(bool a) { Q_D(QLayout); d->autoNewChild = a; }
-
-/*!
- Automatically adding widgets is deprecated. Use addWidget() or
- addLayout() instead.
-*/
-bool QLayout::autoAdd() const { Q_D(const QLayout); return d->autoNewChild; }
-#endif
/*!
@@ -568,13 +477,6 @@ QRect QLayout::contentsRect() const
return d->rect.adjusted(+left, +top, -right, -bottom);
}
-#ifdef QT3_SUPPORT
-bool QLayout::isTopLevel() const
-{
- Q_D(const QLayout);
- return d->topLevel;
-}
-#endif
/*!
Returns the parent widget of this layout, or 0 if this layout is
@@ -720,33 +622,6 @@ void QLayout::widgetEvent(QEvent *e)
}
}
break;
-#ifdef QT3_SUPPORT
- case QEvent::ChildInserted:
- if (d->topLevel && d->autoNewChild) {
- QChildEvent *c = (QChildEvent *)e;
- if (c->child()->isWidgetType()) {
- QWidget *w = (QWidget *)c->child();
- if (!w->isWindow()) {
-#if !defined(QT_NO_MENUBAR) && !defined(QT_NO_TOOLBAR)
- if (qobject_cast<QMenuBar*>(w) && !qobject_cast<QToolBar*>(w->parentWidget())) {
- d->menubar = (QMenuBar *)w;
- invalidate();
- } else
-#endif
-#ifndef QT_NO_SIZEGRIP
- if (qobject_cast<QSizeGrip*>(w) ) {
- //SizeGrip is handled by the dialog itself.
- } else
-#endif
- addItem(QLayoutPrivate::createWidgetItem(this, w));
- }
- }
- }
- break;
- case QEvent::LayoutHint:
- d->activated = false;
- // fall through
-#endif
case QEvent::LayoutRequest:
if (static_cast<QWidget *>(parent())->isVisible())
activate();
@@ -899,17 +774,6 @@ QLayout::~QLayout()
((QWidget*)parent())->d_func()->layout = 0;
}
-#ifdef QT3_SUPPORT
-/*!
- Removes and deletes all items in this layout.
-*/
-void QLayout::deleteAllItems()
-{
- QLayoutItem *l;
- while ((l = takeAt(0)))
- delete l;
-}
-#endif
/*!
This function is called from \c addLayout() or \c insertLayout() functions in
@@ -1019,44 +883,6 @@ void QLayout::addChildWidget(QWidget *w)
QMetaObject::invokeMethod(w, "_q_showIfNotHidden", Qt::QueuedConnection); //show later
}
-#ifdef QT3_SUPPORT
-/*!
- \compat
-
- Sets this layout's parent widget to a fixed size with width \a w
- and height \a h, stopping the user from resizing it, and also
- prevents the layout from resizing it, even if the layout's size
- hint should change. Does nothing if this is not a top-level
- layout (i.e., if parent()->isWidgetType()).
-
- As a special case, if both \a w and \a h are 0, then the layout's
- current sizeHint() is used.
-
- Use \c setResizeMode(Fixed) to stop the widget from being resized
- by the user, while still allowing the layout to resize it when
- the sizeHint() changes.
-
- Use \c setResizeMode(FreeResize) to allow the user to resize the
- widget, while preventing the layout from resizing it.
-
-*/
-void QLayout::freeze(int w, int h)
-{
- Q_D(QLayout);
- if (!d->topLevel)
- return;
- if (w <= 0 || h <= 0) {
- QSize s = totalSizeHint();
- w = s.width();
- h = s.height();
- }
- setSizeConstraint(SetNoConstraint); // layout will not change min/max size
- QWidget *parent = parentWidget();
- if (parent)
- parent->setFixedSize(w, h);
-}
-
-#endif
diff --git a/src/widgets/kernel/qlayout.h b/src/widgets/kernel/qlayout.h
index d9f732bd14..5d14aae58b 100644
--- a/src/widgets/kernel/qlayout.h
+++ b/src/widgets/kernel/qlayout.h
@@ -59,31 +59,6 @@ QT_MODULE(Gui)
class QLayout;
class QSize;
-#ifdef QT3_SUPPORT
-class Q_WIDGETS_EXPORT QLayoutIterator
-{
-public:
- inline QT3_SUPPORT_CONSTRUCTOR QLayoutIterator(QLayout *i) : layout(i), index(0) {}
- inline QLayoutIterator(const QLayoutIterator &i)
- : layout(i.layout), index(i.index) {}
- inline QLayoutIterator &operator=(const QLayoutIterator &i) {
- layout = i.layout;
- index = i.index;
- return *this;
- }
- inline QT3_SUPPORT QLayoutItem *operator++();
- inline QT3_SUPPORT QLayoutItem *current();
- inline QT3_SUPPORT QLayoutItem *takeCurrent();
- inline QT3_SUPPORT void deleteCurrent();
-
-private:
- // hack to avoid deprecated warning
- friend class QLayout;
- inline QLayoutIterator(QLayout *i, bool) : layout(i), index(0) {}
- QLayout *layout;
- int index;
-};
-#endif
class QLayoutPrivate;
@@ -138,10 +113,6 @@ public:
void setSizeConstraint(SizeConstraint);
SizeConstraint sizeConstraint() const;
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT void setResizeMode(SizeConstraint s) {setSizeConstraint(s);}
- inline QT3_SUPPORT SizeConstraint resizeMode() const {return sizeConstraint();}
-#endif
void setMenuBar(QWidget *w);
QWidget *menuBar() const;
@@ -177,10 +148,6 @@ public:
void setEnabled(bool);
bool isEnabled() const;
-#ifdef QT3_SUPPORT
- QT3_SUPPORT void freeze(int w=0, int h=0);
- QT3_SUPPORT bool isTopLevel() const;
-#endif
static QSize closestAcceptableSize(const QWidget *w, const QSize &s);
@@ -189,9 +156,6 @@ protected:
void childEvent(QChildEvent *e);
void addChildLayout(QLayout *l);
void addChildWidget(QWidget *w);
-#ifdef QT3_SUPPORT
- QT3_SUPPORT void deleteAllItems();
-#endif
QRect alignmentRect(const QRect&) const;
protected:
@@ -205,30 +169,8 @@ private:
friend class QApplicationPrivate;
friend class QWidget;
-#ifdef QT3_SUPPORT
-public:
- QT3_SUPPORT_CONSTRUCTOR QLayout(QWidget *parent, int margin, int spacing = -1,
- const char *name = 0);
- QT3_SUPPORT_CONSTRUCTOR QLayout(QLayout *parentLayout, int spacing = -1, const char *name = 0);
- QT3_SUPPORT_CONSTRUCTOR QLayout(int spacing, const char *name = 0);
- inline QT3_SUPPORT QWidget *mainWidget() const { return parentWidget(); }
- inline QT3_SUPPORT void remove(QWidget *w) { removeWidget(w); }
- inline QT3_SUPPORT void add(QWidget *w) { addWidget(w); }
-
- QT3_SUPPORT void setAutoAdd(bool a);
- QT3_SUPPORT bool autoAdd() const;
- inline QT3_SUPPORT QLayoutIterator iterator() { return QLayoutIterator(this,true); }
-
- inline QT3_SUPPORT int defaultBorder() const { return spacing(); }
-#endif
};
-#ifdef QT3_SUPPORT
-inline QLayoutItem *QLayoutIterator::operator++() { return layout->itemAt(++index); }
-inline QLayoutItem *QLayoutIterator::current() { return layout->itemAt(index); }
-inline QLayoutItem *QLayoutIterator::takeCurrent() { return layout->takeAt(index); }
-inline void QLayoutIterator::deleteCurrent() { delete layout->takeAt(index); }
-#endif
//### support old includes
#if 1 //def QT3_SUPPORT
diff --git a/src/widgets/kernel/qsizepolicy.h b/src/widgets/kernel/qsizepolicy.h
index 76067604f9..826991ceb3 100644
--- a/src/widgets/kernel/qsizepolicy.h
+++ b/src/widgets/kernel/qsizepolicy.h
@@ -148,51 +148,6 @@ public:
void transpose();
-#ifdef QT3_SUPPORT
- typedef Policy SizeType;
-#ifndef qdoc
- typedef Qt::Orientations ExpandData;
- enum {
- NoDirection = 0,
- Horizontally = 1,
- Vertically = 2,
- BothDirections = Horizontally | Vertically
- };
-#else
- enum ExpandData {
- NoDirection = 0x0,
- Horizontally = 0x1,
- Vertically = 0x2,
- BothDirections = 0x3
- };
-#endif // qdoc
-
- inline QT3_SUPPORT bool mayShrinkHorizontally() const
- { return horizontalPolicy() & ShrinkFlag; }
- inline QT3_SUPPORT bool mayShrinkVertically() const { return verticalPolicy() & ShrinkFlag; }
- inline QT3_SUPPORT bool mayGrowHorizontally() const { return horizontalPolicy() & GrowFlag; }
- inline QT3_SUPPORT bool mayGrowVertically() const { return verticalPolicy() & GrowFlag; }
- inline QT3_SUPPORT Qt::Orientations expanding() const { return expandingDirections(); }
-
- QT3_SUPPORT_CONSTRUCTOR QSizePolicy(Policy hor, Policy ver, bool hfw)
- : data(hor | (ver<<HSize) | (hfw ? (1U<<2*HSize) : 0)) { }
-
- QT3_SUPPORT_CONSTRUCTOR QSizePolicy(Policy hor, Policy ver, uchar hors, uchar vers, bool hfw = false)
- : data(hor | (ver<<HSize) | (hfw ? (1U<<2*HSize) : 0)) {
- setHorizontalStretch(hors);
- setVerticalStretch(vers);
- }
-
- inline QT3_SUPPORT Policy horData() const { return static_cast<Policy>(data & HMask); }
- inline QT3_SUPPORT Policy verData() const { return static_cast<Policy>((data & VMask) >> HSize); }
- inline QT3_SUPPORT void setHorData(Policy d) { setHorizontalPolicy(d); }
- inline QT3_SUPPORT void setVerData(Policy d) { setVerticalPolicy(d); }
-
- inline QT3_SUPPORT uint horStretch() const { return horizontalStretch(); }
- inline QT3_SUPPORT uint verStretch() const { return verticalStretch(); }
- inline QT3_SUPPORT void setHorStretch(uchar sf) { setHorizontalStretch(sf); }
- inline QT3_SUPPORT void setVerStretch(uchar sf) { setVerticalStretch(sf); }
-#endif
private:
#ifndef QT_NO_DATASTREAM
diff --git a/src/widgets/kernel/qtooltip.h b/src/widgets/kernel/qtooltip.h
index 52fb962edb..3d537f40af 100644
--- a/src/widgets/kernel/qtooltip.h
+++ b/src/widgets/kernel/qtooltip.h
@@ -67,12 +67,6 @@ public:
static void setPalette(const QPalette &);
static QFont font();
static void setFont(const QFont &);
-#ifdef QT3_SUPPORT
- static inline QT3_SUPPORT void add(QWidget *w, const QString &s) { w->setToolTip(s); }
- static inline QT3_SUPPORT void add(QWidget *w, const QRect &, const QString &s)
- { w->setToolTip(s); }
- static inline QT3_SUPPORT void remove(QWidget *w) { w->setToolTip(QString()); }
-#endif
};
#endif // QT_NO_TOOLTIP
diff --git a/src/widgets/kernel/qwhatsthis.cpp b/src/widgets/kernel/qwhatsthis.cpp
index 204a11a3eb..2032b4add7 100644
--- a/src/widgets/kernel/qwhatsthis.cpp
+++ b/src/widgets/kernel/qwhatsthis.cpp
@@ -390,9 +390,6 @@ class QWhatsThisPrivate : public QObject
static QWhatsThisPrivate *instance;
bool eventFilter(QObject *, QEvent *);
QPointer<QAction> action;
-#ifdef QT3_SUPPORT
- QPointer<QToolButton> button;
-#endif
static void say(QWidget *, const QString &, int x = 0, int y = 0);
static void notifyToplevels(QEvent *e);
bool leaveOnMouseRelease;
@@ -437,10 +434,6 @@ QWhatsThisPrivate::~QWhatsThisPrivate()
{
if (action)
action->setChecked(false);
-#ifdef QT3_SUPPORT
- if (button)
- button->setChecked(false);
-#endif
#ifndef QT_NO_CURSOR
QApplication::restoreOverrideCursor();
#endif
@@ -549,66 +542,6 @@ QWhatsThis::QWhatsThis()
{
}
-#ifdef QT3_SUPPORT
-/*!
- \obsolete
-
- Sets the What's This text \a s for the widget \a w.
-
- Use QWidget::setWhatsThis() or QAction::setWhatsThis() instead.
-*/
-void QWhatsThis::add(QWidget *w, const QString &s)
-{
- w->setWhatsThis(s);
-}
-
-/*!
- \obsolete
-
- Remove's the What's This text for the widget \a w.
-
- Use QWidget::setWhatsThis() or QAction::setWhatsThis() instead.
-*/
-void QWhatsThis::remove(QWidget *w)
-{
- w->setWhatsThis(QString());
-}
-
-class QWhatsThisButton : public QToolButton
-{
- Q_OBJECT
-public:
- QWhatsThisButton(QWidget *p) : QToolButton(p) {
- setCheckable(true);
- QPixmap pix( const_cast<const char**>(button_image) );
- setIcon( pix );
- QObject::connect(this, SIGNAL(toggled(bool)), this, SLOT(whatToggled(bool)));
- setAutoRaise(true);
- setFocusPolicy(Qt::NoFocus);
- }
-
-public slots:
- void whatToggled(bool b) {
- if (b) {
- QWhatsThis::enterWhatsThisMode();
- QWhatsThisPrivate::instance->button = this;
- }
- }
-};
-
-/*!
- Returns a new "What's This?" QToolButton with the given \a
- parent. To do this now, create your own QToolButton and a
- QWhatsThis object and call the QWhatsThis object's showText()
- function when the QToolButton is invoked.
-
- Use createAction() instead.
-*/
-QToolButton * QWhatsThis::whatsThisButton(QWidget * parent)
-{
- return new QWhatsThisButton(parent);
-}
-#endif
/*!
This function switches the user interface into "What's This?"
diff --git a/src/widgets/kernel/qwhatsthis.h b/src/widgets/kernel/qwhatsthis.h
index b975b78e3e..9ef96e7197 100644
--- a/src/widgets/kernel/qwhatsthis.h
+++ b/src/widgets/kernel/qwhatsthis.h
@@ -54,9 +54,6 @@ QT_MODULE(Gui)
#ifndef QT_NO_WHATSTHIS
class QAction;
-#ifdef QT3_SUPPORT
-class QToolButton;
-#endif
class Q_WIDGETS_EXPORT QWhatsThis
{
@@ -72,11 +69,6 @@ public:
static QAction *createAction(QObject *parent = 0);
-#ifdef QT3_SUPPORT
- static QT3_SUPPORT void add(QWidget *w, const QString &s);
- static QT3_SUPPORT void remove(QWidget *);
- static QT3_SUPPORT QToolButton *whatsThisButton(QWidget *parent);
-#endif
};
#endif // QT_NO_WHATSTHIS
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 74db6b5b8f..4cb01b9e72 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -1110,23 +1110,6 @@ QWidget::QWidget(QWidget *parent, Qt::WindowFlags f)
}
}
-#ifdef QT3_SUPPORT
-/*!
- \overload
- \obsolete
- */
-QWidget::QWidget(QWidget *parent, const char *name, Qt::WindowFlags f)
- : QObject(*new QWidgetPrivate, 0), QPaintDevice()
-{
- QT_TRY {
- d_func()->init(parent , f);
- setObjectName(QString::fromAscii(name));
- } QT_CATCH(...) {
- QWidgetExceptionCleaner::cleanup(this, d_func());
- QT_RETHROW;
- }
-}
-#endif
/*! \internal
*/
@@ -1406,20 +1389,6 @@ void QWidget::create(WId window, bool initializeWindow, bool destroyOldWindow)
}
}
-#ifdef QT3_SUPPORT
- if (flags & Qt::WStaticContents)
- setAttribute(Qt::WA_StaticContents);
- if (flags & Qt::WDestructiveClose)
- setAttribute(Qt::WA_DeleteOnClose);
- if (flags & Qt::WShowModal)
- setWindowModality(Qt::ApplicationModal);
- if (flags & Qt::WMouseNoMask)
- setAttribute(Qt::WA_MouseNoMask);
- if (flags & Qt::WGroupLeader)
- setAttribute(Qt::WA_GroupLeader);
- if (flags & Qt::WNoMousePropagation)
- setAttribute(Qt::WA_NoMousePropagation);
-#endif
static int paintOnScreenEnv = -1;
if (paintOnScreenEnv == -1)
@@ -1536,12 +1505,6 @@ QWidget::~QWidget()
d->focus_next = d->focus_prev = 0;
}
-#ifdef QT3_SUPPORT
- if (QApplicationPrivate::main_widget == this) { // reset main widget
- QApplicationPrivate::main_widget = 0;
- QApplication::quit();
- }
-#endif
QT_TRY {
clearFocus();
@@ -2683,9 +2646,6 @@ void QWidgetPrivate::setStyle_helper(QStyle *newStyle, bool propagate, bool
QEvent e(QEvent::StyleChange);
QApplication::sendEvent(q, &e);
-#ifdef QT3_SUPPORT
- q->styleChange(*oldStyle);
-#endif
#ifndef QT_NO_STYLE_STYLESHEET
// dereference the old stylesheet style
@@ -2739,19 +2699,6 @@ void QWidgetPrivate::inheritStyle()
#endif // QT_NO_STYLE_STYLESHEET
}
-#ifdef QT3_SUPPORT
-/*!
- \overload
-
- Sets the widget's GUI style to \a style using the QStyleFactory.
-*/
-QStyle* QWidget::setStyle(const QString &style)
-{
- QStyle *s = QStyleFactory::create(style);
- setStyle(s);
- return s;
-}
-#endif
/*!
\fn bool QWidget::isWindow() const
@@ -2857,10 +2804,6 @@ void QWidget::showMinimized()
return;
ensurePolished();
-#ifdef QT3_SUPPORT
- if (parent())
- QApplication::sendPostedEvents(parent(), QEvent::ChildInserted);
-#endif
if (!isMin)
setWindowState((windowState() & ~Qt::WindowActive) | Qt::WindowMinimized);
@@ -3000,10 +2943,6 @@ void QWidget::showFullScreen()
}
#endif // Q_WS_MAC
ensurePolished();
-#ifdef QT3_SUPPORT
- if (parent())
- QApplication::sendPostedEvents(parent(), QEvent::ChildInserted);
-#endif
setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowMaximized))
| Qt::WindowFullScreen);
@@ -3024,10 +2963,6 @@ void QWidget::showFullScreen()
void QWidget::showMaximized()
{
ensurePolished();
-#ifdef QT3_SUPPORT
- if (parent())
- QApplication::sendPostedEvents(parent(), QEvent::ChildInserted);
-#endif
setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowFullScreen))
| Qt::WindowMaximized);
@@ -3056,10 +2991,6 @@ void QWidget::showMaximized()
void QWidget::showNormal()
{
ensurePolished();
-#ifdef QT3_SUPPORT
- if (parent())
- QApplication::sendPostedEvents(parent(), QEvent::ChildInserted);
-#endif
setWindowState(windowState() & ~(Qt::WindowMinimized
| Qt::WindowMaximized
@@ -3307,9 +3238,6 @@ void QWidgetPrivate::setEnabled_helper(bool enable)
#endif //QT_NO_IM
QEvent e(QEvent::EnabledChange);
QApplication::sendEvent(q, &e);
-#ifdef QT3_SUPPORT
- q->enabledChange(!enable); // compatibility
-#endif
}
/*!
@@ -4229,139 +4157,6 @@ QWidget *QWidget::nativeParentWidget() const
Use window() instead.
*/
-#ifdef QT3_SUPPORT
-/*!
- Returns the color role used for painting the widget's background.
-
- Use QPalette(backgroundRole(()) instead.
-*/
-Qt::BackgroundMode QWidget::backgroundMode() const
-{
- if (testAttribute(Qt::WA_NoSystemBackground))
- return Qt::NoBackground;
- switch(backgroundRole()) {
- case QPalette::WindowText:
- return Qt::PaletteForeground;
- case QPalette::Button:
- return Qt::PaletteButton;
- case QPalette::Light:
- return Qt::PaletteLight;
- case QPalette::Midlight:
- return Qt::PaletteMidlight;
- case QPalette::Dark:
- return Qt::PaletteDark;
- case QPalette::Mid:
- return Qt::PaletteMid;
- case QPalette::Text:
- return Qt::PaletteText;
- case QPalette::BrightText:
- return Qt::PaletteBrightText;
- case QPalette::Base:
- return Qt::PaletteBase;
- case QPalette::Window:
- return Qt::PaletteBackground;
- case QPalette::Shadow:
- return Qt::PaletteShadow;
- case QPalette::Highlight:
- return Qt::PaletteHighlight;
- case QPalette::HighlightedText:
- return Qt::PaletteHighlightedText;
- case QPalette::ButtonText:
- return Qt::PaletteButtonText;
- case QPalette::Link:
- return Qt::PaletteLink;
- case QPalette::LinkVisited:
- return Qt::PaletteLinkVisited;
- default:
- break;
- }
- return Qt::NoBackground;
-}
-
-/*!
- \fn void QWidget::setBackgroundMode(Qt::BackgroundMode
- widgetBackground, Qt::BackgroundMode paletteBackground)
-
- Sets the color role used for painting the widget's background to
- background mode \a widgetBackground. The \a paletteBackground mode
- parameter is ignored.
-*/
-void QWidget::setBackgroundMode(Qt::BackgroundMode m, Qt::BackgroundMode)
-{
- Q_D(QWidget);
- if(m == Qt::NoBackground) {
- setAttribute(Qt::WA_NoSystemBackground, true);
- return;
- }
- setAttribute(Qt::WA_NoSystemBackground, false);
- d->fg_role = QPalette::NoRole;
- QPalette::ColorRole role = d->bg_role;
- switch(m) {
- case Qt::FixedColor:
- case Qt::FixedPixmap:
- break;
- case Qt::PaletteForeground:
- role = QPalette::WindowText;
- break;
- case Qt::PaletteButton:
- role = QPalette::Button;
- break;
- case Qt::PaletteLight:
- role = QPalette::Light;
- break;
- case Qt::PaletteMidlight:
- role = QPalette::Midlight;
- break;
- case Qt::PaletteDark:
- role = QPalette::Dark;
- break;
- case Qt::PaletteMid:
- role = QPalette::Mid;
- break;
- case Qt::PaletteText:
- role = QPalette::Text;
- break;
- case Qt::PaletteBrightText:
- role = QPalette::BrightText;
- break;
- case Qt::PaletteBase:
- role = QPalette::Base;
- break;
- case Qt::PaletteBackground:
- role = QPalette::Window;
- break;
- case Qt::PaletteShadow:
- role = QPalette::Shadow;
- break;
- case Qt::PaletteHighlight:
- role = QPalette::Highlight;
- break;
- case Qt::PaletteHighlightedText:
- role = QPalette::HighlightedText;
- break;
- case Qt::PaletteButtonText:
- role = QPalette::ButtonText;
- break;
- case Qt::PaletteLink:
- role = QPalette::Link;
- break;
- case Qt::PaletteLinkVisited:
- role = QPalette::LinkVisited;
- break;
- case Qt::X11ParentRelative:
- d->fg_role = role = QPalette::NoRole;
- default:
- break;
- }
- setBackgroundRole(role);
-}
-
-/*!
- The widget mapper is no longer part of the public API.
-*/
-QT3_SUPPORT QWidgetMapper *QWidget::wmapper() { return QWidgetPrivate::mapper; }
-
-#endif
/*!
@@ -4782,9 +4577,6 @@ void QWidgetPrivate::updateFont(const QFont &font)
cssStyle = extra ? qobject_cast<const QStyleSheetStyle*>(extra->style) : 0;
#endif
-#ifdef QT3_SUPPORT
- QFont old = data.fnt;
-#endif
data.fnt = QFont(font, q);
#if defined(Q_WS_X11)
// make sure the font set on this widget is associated with the correct screen
@@ -4829,9 +4621,6 @@ void QWidgetPrivate::updateFont(const QFont &font)
QEvent e(QEvent::FontChange);
QApplication::sendEvent(q, &e);
-#ifdef QT3_SUPPORT
- q->fontChange(old);
-#endif
}
void QWidgetPrivate::setLayoutDirection_helper(Qt::LayoutDirection direction)
@@ -7304,10 +7093,6 @@ void QWidgetPrivate::show_recursive()
createRecursively();
q->ensurePolished();
-#ifdef QT3_SUPPORT
- if(sendChildEvents)
- QApplication::sendPostedEvents(q, QEvent::ChildInserted);
-#endif
if (!q->isWindow() && q->parentWidget()->d_func()->layout && !q->parentWidget()->data->in_show)
q->parentWidget()->d_func()->layout->activate();
// activate our layout before we and our children become visible
@@ -7392,11 +7177,6 @@ void QWidgetPrivate::show_helper()
// finally show all children recursively
showChildren(false);
-#ifdef QT3_SUPPORT
- if (q->parentWidget() && sendChildEvents)
- QApplication::sendPostedEvents(q->parentWidget(),
- QEvent::ChildInserted);
-#endif
// popup handling: new popups and tools need to be raised, and
@@ -7624,9 +7404,6 @@ void QWidget::setVisible(bool visible)
if (needUpdateGeometry)
d->updateGeometry_helper(true);
-#ifdef QT3_SUPPORT
- QApplication::sendPostedEvents(this, QEvent::ChildInserted);
-#endif
// activate our layout before we and our children become visible
if (d->layout)
d->layout->activate();
@@ -7817,9 +7594,6 @@ bool QWidgetPrivate::close_helper(CloseMode mode)
QPointer<QWidget> that = q;
QPointer<QWidget> parentWidget = q->parentWidget();
-#ifdef QT3_SUPPORT
- bool isMain = (QApplicationPrivate::main_widget == q);
-#endif
bool quitOnClose = q->testAttribute(Qt::WA_QuitOnClose);
if (mode != CloseNoEvent) {
QCloseEvent e;
@@ -7836,10 +7610,6 @@ bool QWidgetPrivate::close_helper(CloseMode mode)
if (!that.isNull() && !q->isHidden())
q->hide();
-#ifdef QT3_SUPPORT
- if (isMain)
- QApplication::quit();
-#endif
// Attempt to close the application only if this has WA_QuitOnClose set and a non-visible parent
quitOnClose = quitOnClose && (parentWidget.isNull() || !parentWidget->isVisible());
@@ -7969,15 +7739,6 @@ bool QWidget::isVisibleTo(QWidget* ancestor) const
return !w->isHidden();
}
-#ifdef QT3_SUPPORT
-/*!
- Use visibleRegion() instead.
-*/
-QRect QWidget::visibleRect() const
-{
- return d_func()->clipRect();
-}
-#endif
/*!
Returns the unobscured region where paint events can occur.
@@ -8264,11 +8025,6 @@ bool QWidget::event(QEvent *event)
tabletEvent((QTabletEvent*)event);
break;
#endif
-#ifdef QT3_SUPPORT
- case QEvent::Accel:
- event->ignore();
- return false;
-#endif
case QEvent::KeyPress: {
QKeyEvent *k = (QKeyEvent *)event;
bool res = false;
@@ -8353,10 +8109,6 @@ bool QWidget::event(QEvent *event)
d->resolveFont();
if (!QApplication::palette(this).isCopyOf(QApplication::palette()))
d->resolvePalette();
-#ifdef QT3_SUPPORT
- if(d->sendChildEvents)
- QApplication::sendPostedEvents(this, QEvent::ChildInserted);
-#endif
}
break;
@@ -8511,9 +8263,6 @@ bool QWidget::event(QEvent *event)
case QEvent::WindowActivate:
case QEvent::WindowDeactivate: {
-#ifdef QT3_SUPPORT
- windowActivationChange(event->type() != QEvent::WindowActivate);
-#endif
if (isVisible() && !palette().isEqual(QPalette::Active, QPalette::Inactive))
update();
QList<QObject*> childList = d->children;
@@ -8531,9 +8280,6 @@ bool QWidget::event(QEvent *event)
break; }
case QEvent::LanguageChange:
-#ifdef QT3_SUPPORT
- languageChange();
-#endif
changeEvent(event);
{
QList<QObject*> childList = d->children;
@@ -10129,14 +9875,6 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
if (parent && d->sendChildEvents) {
QChildEvent e(QEvent::ChildAdded, this);
QApplication::sendEvent(parent, &e);
-#ifdef QT3_SUPPORT
- if (parent->d_func()->pendingChildInsertedEvents.isEmpty()) {
- QApplication::postEvent(parent,
- new QEvent(QEvent::ChildInsertedRequest),
- Qt::HighEventPriority);
- }
- parent->d_func()->pendingChildInsertedEvents.append(this);
-#endif
}
//### already hidden above ---> must probably do something smart on the mac
@@ -10462,86 +10200,6 @@ void QWidget::update(const QRegion &rgn)
}
}
-#ifdef QT3_SUPPORT
-/*!
- Clear the rectangle at point (\a x, \a y) of width \a w and height
- \a h.
-
- \warning This is best done in a paintEvent().
-*/
-void QWidget::erase_helper(int x, int y, int w, int h)
-{
- if (testAttribute(Qt::WA_NoSystemBackground) || testAttribute(Qt::WA_UpdatesDisabled) || !testAttribute(Qt::WA_WState_Visible))
- return;
- if (w < 0)
- w = data->crect.width() - x;
- if (h < 0)
- h = data->crect.height() - y;
- if (w != 0 && h != 0) {
- QPainter p(this);
- p.eraseRect(QRect(x, y, w, h));
- }
-}
-
-/*!
- \overload
-
- Clear the given region, \a rgn.
-
- Drawing may only take place in a QPaintEvent. Overload
- paintEvent() to do your erasing and call update() to schedule a
- replaint whenever necessary. See also QPainter.
-*/
-void QWidget::erase(const QRegion& rgn)
-{
- if (testAttribute(Qt::WA_NoSystemBackground) || testAttribute(Qt::WA_UpdatesDisabled) || !testAttribute(Qt::WA_WState_Visible))
- return;
-
- QPainter p(this);
- p.setClipRegion(rgn);
- p.eraseRect(rgn.boundingRect());
-}
-
-void QWidget::drawText_helper(int x, int y, const QString &str)
-{
- if(!testAttribute(Qt::WA_WState_Visible))
- return;
- QPainter paint(this);
- paint.drawText(x, y, str);
-}
-
-
-/*!
- Closes the widget.
-
- Use the no-argument overload instead.
-*/
-bool QWidget::close(bool alsoDelete)
-{
- QPointer<QWidget> that = this;
- bool accepted = close();
- if (alsoDelete && accepted && that)
- deleteLater();
- return accepted;
-}
-
-void QWidget::setIcon(const QPixmap &i)
-{
- setWindowIcon(i);
-}
-
-/*!
- Return's the widget's icon.
-
- Use windowIcon() instead.
-*/
-const QPixmap *QWidget::icon() const
-{
- Q_D(const QWidget);
- return (d->extra && d->extra->topextra) ? d->extra->topextra->iconPixmap : 0;
-}
-
-#endif // QT3_SUPPORT
/*!
\internal
diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h
index 91f09db449..3db0408bbd 100644
--- a/src/widgets/kernel/qwidget.h
+++ b/src/widgets/kernel/qwidget.h
@@ -230,9 +230,6 @@ public:
Q_DECLARE_FLAGS(RenderFlags, RenderFlag)
explicit QWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
-#ifdef QT3_SUPPORT
- QT3_SUPPORT_CONSTRUCTOR QWidget(QWidget* parent, const char *name, Qt::WindowFlags f = 0);
-#endif
~QWidget();
int devType() const;
@@ -591,9 +588,6 @@ public:
inline Qt::WindowType windowType() const;
static QWidget *find(WId);
-#ifdef QT3_SUPPORT
- static QT3_SUPPORT QWidgetMapper *wmapper();
-#endif
inline QWidget *childAt(int x, int y) const;
QWidget *childAt(const QPoint &p) const;
@@ -815,99 +809,6 @@ private:
QWidgetData *data;
-#ifdef QT3_SUPPORT
-public:
- inline QT3_SUPPORT bool isUpdatesEnabled() const { return updatesEnabled(); }
- QT3_SUPPORT QStyle *setStyle(const QString&);
- inline QT3_SUPPORT bool isVisibleToTLW() const;
- QT3_SUPPORT QRect visibleRect() const;
- inline QT3_SUPPORT void iconify() { showMinimized(); }
- inline QT3_SUPPORT void constPolish() const { ensurePolished(); }
- inline QT3_SUPPORT void polish() { ensurePolished(); }
- inline QT3_SUPPORT void reparent(QWidget *parent, Qt::WindowFlags f, const QPoint &p, bool showIt=false)
- { setParent(parent, f); setGeometry(p.x(),p.y(),width(),height()); if (showIt) show(); }
- inline QT3_SUPPORT void reparent(QWidget *parent, const QPoint &p, bool showIt=false)
- { setParent(parent, windowFlags() & ~Qt::WindowType_Mask); setGeometry(p.x(),p.y(),width(),height()); if (showIt) show(); }
- inline QT3_SUPPORT void recreate(QWidget *parent, Qt::WindowFlags f, const QPoint & p, bool showIt=false)
- { setParent(parent, f); setGeometry(p.x(),p.y(),width(),height()); if (showIt) show(); }
- inline QT3_SUPPORT void setSizePolicy(QSizePolicy::Policy hor, QSizePolicy::Policy ver, bool hfw)
- { QSizePolicy sp(hor, ver); sp.setHeightForWidth(hfw); setSizePolicy(sp);}
- inline QT3_SUPPORT bool hasMouse() const { return testAttribute(Qt::WA_UnderMouse); }
-#ifndef QT_NO_CURSOR
- inline QT3_SUPPORT bool ownCursor() const { return testAttribute(Qt::WA_SetCursor); }
-#endif
- inline QT3_SUPPORT bool ownFont() const { return testAttribute(Qt::WA_SetFont); }
- inline QT3_SUPPORT void unsetFont() { setFont(QFont()); }
- inline QT3_SUPPORT bool ownPalette() const { return testAttribute(Qt::WA_SetPalette); }
- inline QT3_SUPPORT void unsetPalette() { setPalette(QPalette()); }
- Qt::BackgroundMode QT3_SUPPORT backgroundMode() const;
- void QT3_SUPPORT setBackgroundMode(Qt::BackgroundMode, Qt::BackgroundMode = Qt::PaletteBackground);
- const QT3_SUPPORT QColor &eraseColor() const;
- void QT3_SUPPORT setEraseColor(const QColor &);
- const QT3_SUPPORT QColor &foregroundColor() const;
- const QT3_SUPPORT QPixmap *erasePixmap() const;
- void QT3_SUPPORT setErasePixmap(const QPixmap &);
- const QT3_SUPPORT QColor &paletteForegroundColor() const;
- void QT3_SUPPORT setPaletteForegroundColor(const QColor &);
- const QT3_SUPPORT QColor &paletteBackgroundColor() const;
- void QT3_SUPPORT setPaletteBackgroundColor(const QColor &);
- const QT3_SUPPORT QPixmap *paletteBackgroundPixmap() const;
- void QT3_SUPPORT setPaletteBackgroundPixmap(const QPixmap &);
- const QT3_SUPPORT QBrush& backgroundBrush() const;
- const QT3_SUPPORT QColor &backgroundColor() const;
- const QT3_SUPPORT QPixmap *backgroundPixmap() const;
- void QT3_SUPPORT setBackgroundPixmap(const QPixmap &);
- QT3_SUPPORT void setBackgroundColor(const QColor &);
- 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); }
- inline QT3_SUPPORT void setPalette(const QPalette &p, bool) { setPalette(p); }
- enum BackgroundOrigin { WidgetOrigin, ParentOrigin, WindowOrigin, AncestorOrigin };
- inline QT3_SUPPORT void setBackgroundOrigin(BackgroundOrigin) {}
- inline QT3_SUPPORT BackgroundOrigin backgroundOrigin() const { return WindowOrigin; }
- inline QT3_SUPPORT QPoint backgroundOffset() const { return QPoint(); }
- inline QT3_SUPPORT void repaint(bool) { repaint(); }
- inline QT3_SUPPORT void repaint(int x, int y, int w, int h, bool) { repaint(x,y,w,h); }
- inline QT3_SUPPORT void repaint(const QRect &r, bool) { repaint(r); }
- inline QT3_SUPPORT void repaint(const QRegion &rgn, bool) { repaint(rgn); }
- QT3_SUPPORT void erase();
- inline QT3_SUPPORT void erase(int x, int y, int w, int h) { erase_helper(x, y, w, h); }
- QT3_SUPPORT void erase(const QRect &);
- QT3_SUPPORT void erase(const QRegion &);
- QT3_SUPPORT void drawText(const QPoint &p, const QString &s)
- { drawText_helper(p.x(), p.y(), s); }
- inline QT3_SUPPORT void drawText(int x, int y, const QString &s)
- { drawText_helper(x, y, s); }
- QT3_SUPPORT bool close(bool);
- inline QT3_SUPPORT QWidget *childAt(int x, int y, bool includeThis) const
- {
- QWidget *w = childAt(x, y);
- return w ? w : ((includeThis && rect().contains(x,y))?const_cast<QWidget*>(this):0);
- }
- inline QT3_SUPPORT QWidget *childAt(const QPoint &p, bool includeThis) const
- {
- QWidget *w = childAt(p);
- return w ? w : ((includeThis && rect().contains(p))?const_cast<QWidget*>(this):0);
- }
- inline QT3_SUPPORT void setCaption(const QString &c) { setWindowTitle(c); }
- QT3_SUPPORT void setIcon(const QPixmap &i);
- inline QT3_SUPPORT void setIconText(const QString &it) { setWindowIconText(it); }
- inline QT3_SUPPORT QString caption() const { return windowTitle(); }
- QT3_SUPPORT const QPixmap *icon() const;
- inline QT3_SUPPORT QString iconText() const { return windowIconText(); }
- inline QT3_SUPPORT void setInputMethodEnabled(bool b) { setAttribute(Qt::WA_InputMethodEnabled, b); }
- inline QT3_SUPPORT bool isInputMethodEnabled() const { return testAttribute(Qt::WA_InputMethodEnabled); }
- inline QT3_SUPPORT void setActiveWindow() { activateWindow(); }
- inline QT3_SUPPORT bool isShown() const { return !isHidden(); }
- inline QT3_SUPPORT bool isDialog() const { return windowType() == Qt::Dialog; }
- inline QT3_SUPPORT bool isPopup() const { return windowType() == Qt::Popup; }
- inline QT3_SUPPORT bool isDesktop() const { return windowType() == Qt::Desktop; }
-
-
-private:
- void drawText_helper(int x, int y, const QString &);
- void erase_helper(int x, int y, int w, int h);
-#endif // QT3_SUPPORT
protected:
virtual void styleChange(QStyle&); // compat
@@ -1045,42 +946,6 @@ inline bool QWidget::testAttribute(Qt::WidgetAttribute attribute) const
return testAttribute_helper(attribute);
}
-#ifdef QT3_SUPPORT
-inline bool QWidget::isVisibleToTLW() const
-{ return isVisible(); }
-inline QWidget *QWidget::parentWidget(bool sameWindow) const
-{
- if (sameWindow && isWindow())
- return 0;
- return static_cast<QWidget *>(QObject::parent());
-}
-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()); }
-inline void QWidget::setBackgroundPixmap(const QPixmap &pm)
-{ QPalette p = palette(); p.setBrush(backgroundRole(), QBrush(pm)); setPalette(p); }
-inline const QPixmap *QWidget::backgroundPixmap() const { return 0; }
-inline void QWidget::setBackgroundColor(const QColor &c)
-{ QPalette p = palette(); p.setColor(backgroundRole(), c); setPalette(p); }
-inline const QColor & QWidget::backgroundColor() const { return palette().color(backgroundRole()); }
-inline const QColor &QWidget::foregroundColor() const { return palette().color(foregroundRole());}
-inline const QColor &QWidget::eraseColor() const { return palette().color(backgroundRole()); }
-inline void QWidget::setEraseColor(const QColor &c)
-{ QPalette p = palette(); p.setColor(backgroundRole(), c); setPalette(p); }
-inline const QPixmap *QWidget::erasePixmap() const { return 0; }
-inline void QWidget::setErasePixmap(const QPixmap &pm)
-{ QPalette p = palette(); p.setBrush(backgroundRole(), QBrush(pm)); setPalette(p); }
-inline const QColor &QWidget::paletteForegroundColor() const { return palette().color(foregroundRole());}
-inline const QColor &QWidget::paletteBackgroundColor() const { return palette().color(backgroundRole()); }
-inline void QWidget::setPaletteBackgroundColor(const QColor &c)
-{ QPalette p = palette(); p.setColor(backgroundRole(), c); setPalette(p); }
-inline const QPixmap *QWidget::paletteBackgroundPixmap() const
-{ return 0; }
-inline void QWidget::setPaletteBackgroundPixmap(const QPixmap &pm)
-{ QPalette p = palette(); p.setBrush(backgroundRole(), QBrush(pm)); setPalette(p); }
-inline QT3_SUPPORT void QWidget::erase() { erase_helper(0, 0, data->crect.width(), data->crect.height()); }
-inline QT3_SUPPORT void QWidget::erase(const QRect &r) { erase_helper(r.x(), r.y(), r.width(), r.height()); }
-#endif
#define QWIDGETSIZE_MAX ((1<<24)-1)