summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp4
-rw-r--r--src/widgets/dialogs/qfontdialog.cpp4
-rw-r--r--src/widgets/kernel/qaction.cpp17
-rw-r--r--src/widgets/kernel/qshortcut.cpp3
-rw-r--r--src/widgets/styles/qproxystyle.cpp11
-rw-r--r--src/widgets/util/qsystemtrayicon.cpp2
-rw-r--r--src/widgets/util/qundostack.cpp4
-rw-r--r--src/widgets/widgets/qcheckbox.cpp4
-rw-r--r--src/widgets/widgets/qcommandlinkbutton.cpp9
-rw-r--r--src/widgets/widgets/qdialogbuttonbox.cpp10
-rw-r--r--src/widgets/widgets/qdockwidget.cpp4
-rw-r--r--src/widgets/widgets/qgroupbox.cpp4
-rw-r--r--src/widgets/widgets/qkeysequenceedit.cpp12
-rw-r--r--src/widgets/widgets/qlabel.cpp4
-rw-r--r--src/widgets/widgets/qlcdnumber.cpp5
-rw-r--r--src/widgets/widgets/qlineedit.cpp4
-rw-r--r--src/widgets/widgets/qmenu.cpp3
-rw-r--r--src/widgets/widgets/qpushbutton.cpp8
-rw-r--r--src/widgets/widgets/qradiobutton.cpp4
-rw-r--r--src/widgets/widgets/qscrollbar.cpp4
-rw-r--r--src/widgets/widgets/qslider.cpp4
-rw-r--r--src/widgets/widgets/qsplitter.cpp5
-rw-r--r--src/widgets/widgets/qtoolbar.cpp4
23 files changed, 33 insertions, 100 deletions
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index bc1a0365c7..5494036827 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -1948,10 +1948,8 @@ static const Qt::WindowFlags DefaultWindowFlags =
Constructs a color dialog with the given \a parent.
*/
QColorDialog::QColorDialog(QWidget *parent)
- : QDialog(*new QColorDialogPrivate, parent, DefaultWindowFlags)
+ : QColorDialog(QColor(Qt::white), parent)
{
- Q_D(QColorDialog);
- d->init(Qt::white);
}
/*!
diff --git a/src/widgets/dialogs/qfontdialog.cpp b/src/widgets/dialogs/qfontdialog.cpp
index 5312d2bc1e..1c4166c567 100644
--- a/src/widgets/dialogs/qfontdialog.cpp
+++ b/src/widgets/dialogs/qfontdialog.cpp
@@ -168,10 +168,8 @@ QFontDialog::QFontDialog(QWidget *parent)
\a initial color.
*/
QFontDialog::QFontDialog(const QFont &initial, QWidget *parent)
- : QDialog(*new QFontDialogPrivate, parent, DefaultWindowFlags)
+ : QFontDialog(parent)
{
- Q_D(QFontDialog);
- d->init();
setCurrentFont(initial);
}
diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp
index 718ecffcc9..88b29e9147 100644
--- a/src/widgets/kernel/qaction.cpp
+++ b/src/widgets/kernel/qaction.cpp
@@ -279,12 +279,8 @@ void QActionPrivate::setShortcutEnabled(bool enable, QShortcutMap &map)
group the action will be automatically inserted into the group.
*/
QAction::QAction(QObject* parent)
- : QObject(*(new QActionPrivate), parent)
+ : QAction(*new QActionPrivate, parent)
{
- Q_D(QAction);
- d->group = qobject_cast<QActionGroup *>(parent);
- if (d->group)
- d->group->addAction(this);
}
@@ -302,13 +298,10 @@ QAction::QAction(QObject* parent)
*/
QAction::QAction(const QString &text, QObject* parent)
- : QObject(*(new QActionPrivate), parent)
+ : QAction(parent)
{
Q_D(QAction);
d->text = text;
- d->group = qobject_cast<QActionGroup *>(parent);
- if (d->group)
- d->group->addAction(this);
}
/*!
@@ -324,14 +317,10 @@ QAction::QAction(const QString &text, QObject* parent)
setToolTip().
*/
QAction::QAction(const QIcon &icon, const QString &text, QObject* parent)
- : QObject(*(new QActionPrivate), parent)
+ : QAction(text, parent)
{
Q_D(QAction);
d->icon = icon;
- d->text = text;
- d->group = qobject_cast<QActionGroup *>(parent);
- if (d->group)
- d->group->addAction(this);
}
/*!
diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp
index bf162249d0..7bd9e74924 100644
--- a/src/widgets/kernel/qshortcut.cpp
+++ b/src/widgets/kernel/qshortcut.cpp
@@ -456,12 +456,11 @@ QShortcut::QShortcut(QWidget *parent)
QShortcut::QShortcut(const QKeySequence &key, QWidget *parent,
const char *member, const char *ambiguousMember,
Qt::ShortcutContext context)
- : QObject(*new QShortcutPrivate, parent)
+ : QShortcut(parent)
{
QAPP_CHECK("QShortcut");
Q_D(QShortcut);
- Q_ASSERT(parent != 0);
d->sc_context = context;
d->sc_sequence = key;
d->redoGrab(qApp->d_func()->shortcutMap);
diff --git a/src/widgets/styles/qproxystyle.cpp b/src/widgets/styles/qproxystyle.cpp
index 182c974729..5739678932 100644
--- a/src/widgets/styles/qproxystyle.cpp
+++ b/src/widgets/styles/qproxystyle.cpp
@@ -131,16 +131,9 @@ QProxyStyle::QProxyStyle(QStyle *style) :
\sa QStyleFactory::create()
*/
-QProxyStyle::QProxyStyle(const QString &key) :
- QCommonStyle(*new QProxyStylePrivate())
+QProxyStyle::QProxyStyle(const QString &key)
+ : QProxyStyle(QStyleFactory::create(key))
{
- Q_D(QProxyStyle);
- QStyle *style = QStyleFactory::create(key);
- if (style) {
- d->baseStyle = style;
- style->setProxy(this);
- style->setParent(this); // Take ownership
- }
}
/*!
diff --git a/src/widgets/util/qsystemtrayicon.cpp b/src/widgets/util/qsystemtrayicon.cpp
index 1f1b7a17b5..7b0ecc6972 100644
--- a/src/widgets/util/qsystemtrayicon.cpp
+++ b/src/widgets/util/qsystemtrayicon.cpp
@@ -141,7 +141,7 @@ QSystemTrayIcon::QSystemTrayIcon(QObject *parent)
\sa visible
*/
QSystemTrayIcon::QSystemTrayIcon(const QIcon &icon, QObject *parent)
-: QObject(*new QSystemTrayIconPrivate(), parent)
+ : QSystemTrayIcon(parent)
{
setIcon(icon);
}
diff --git a/src/widgets/util/qundostack.cpp b/src/widgets/util/qundostack.cpp
index 7f6a56e0ec..7361adfdd5 100644
--- a/src/widgets/util/qundostack.cpp
+++ b/src/widgets/util/qundostack.cpp
@@ -110,10 +110,8 @@ QT_BEGIN_NAMESPACE
*/
QUndoCommand::QUndoCommand(const QString &text, QUndoCommand *parent)
+ : QUndoCommand(parent)
{
- d = new QUndoCommandPrivate;
- if (parent != 0)
- parent->d->child_list.append(this);
setText(text);
}
diff --git a/src/widgets/widgets/qcheckbox.cpp b/src/widgets/widgets/qcheckbox.cpp
index 19369d6cb1..d4ba17b08e 100644
--- a/src/widgets/widgets/qcheckbox.cpp
+++ b/src/widgets/widgets/qcheckbox.cpp
@@ -204,10 +204,8 @@ QCheckBox::QCheckBox(QWidget *parent)
*/
QCheckBox::QCheckBox(const QString &text, QWidget *parent)
- : QAbstractButton (*new QCheckBoxPrivate, parent)
+ : QCheckBox(parent)
{
- Q_D(QCheckBox);
- d->init();
setText(text);
}
diff --git a/src/widgets/widgets/qcommandlinkbutton.cpp b/src/widgets/widgets/qcommandlinkbutton.cpp
index 2ec8b1c41a..b6ec2a8d31 100644
--- a/src/widgets/widgets/qcommandlinkbutton.cpp
+++ b/src/widgets/widgets/qcommandlinkbutton.cpp
@@ -281,23 +281,18 @@ QCommandLinkButton::QCommandLinkButton(QWidget *parent)
*/
QCommandLinkButton::QCommandLinkButton(const QString &text, QWidget *parent)
- : QPushButton(*new QCommandLinkButtonPrivate, parent)
+ : QCommandLinkButton(parent)
{
- Q_D(QCommandLinkButton);
setText(text);
- d->init();
}
/*!
Constructs a command link with a \a text, a \a description, and a \a parent.
*/
QCommandLinkButton::QCommandLinkButton(const QString &text, const QString &description, QWidget *parent)
- : QPushButton(*new QCommandLinkButtonPrivate, parent)
+ : QCommandLinkButton(text, parent)
{
- Q_D(QCommandLinkButton);
- setText(text);
setDescription(description);
- d->init();
}
/*!
diff --git a/src/widgets/widgets/qdialogbuttonbox.cpp b/src/widgets/widgets/qdialogbuttonbox.cpp
index 2b68c308ec..0d369eb28c 100644
--- a/src/widgets/widgets/qdialogbuttonbox.cpp
+++ b/src/widgets/widgets/qdialogbuttonbox.cpp
@@ -462,9 +462,8 @@ void QDialogButtonBoxPrivate::retranslateStrings()
\sa orientation, addButton()
*/
QDialogButtonBox::QDialogButtonBox(QWidget *parent)
- : QWidget(*new QDialogButtonBoxPrivate(Qt::Horizontal), parent, 0)
+ : QDialogButtonBox(Qt::Horizontal, parent)
{
- d_func()->initLayout();
}
/*!
@@ -487,10 +486,8 @@ QDialogButtonBox::QDialogButtonBox(Qt::Orientation orientation, QWidget *parent)
\sa orientation, addButton()
*/
QDialogButtonBox::QDialogButtonBox(StandardButtons buttons, QWidget *parent)
- : QWidget(*new QDialogButtonBoxPrivate(Qt::Horizontal), parent, 0)
+ : QDialogButtonBox(buttons, Qt::Horizontal, parent)
{
- d_func()->initLayout();
- d_func()->createStandardButtons(buttons);
}
/*!
@@ -501,9 +498,8 @@ QDialogButtonBox::QDialogButtonBox(StandardButtons buttons, QWidget *parent)
*/
QDialogButtonBox::QDialogButtonBox(StandardButtons buttons, Qt::Orientation orientation,
QWidget *parent)
- : QWidget(*new QDialogButtonBoxPrivate(orientation), parent, 0)
+ : QDialogButtonBox(orientation, parent)
{
- d_func()->initLayout();
d_func()->createStandardButtons(buttons);
}
diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp
index 3ddf5d4dc6..2358568efe 100644
--- a/src/widgets/widgets/qdockwidget.cpp
+++ b/src/widgets/widgets/qdockwidget.cpp
@@ -1224,10 +1224,8 @@ QDockWidget::QDockWidget(QWidget *parent, Qt::WindowFlags flags)
\sa setWindowTitle()
*/
QDockWidget::QDockWidget(const QString &title, QWidget *parent, Qt::WindowFlags flags)
- : QWidget(*new QDockWidgetPrivate, parent, flags)
+ : QDockWidget(parent, flags)
{
- Q_D(QDockWidget);
- d->init();
setWindowTitle(title);
}
diff --git a/src/widgets/widgets/qgroupbox.cpp b/src/widgets/widgets/qgroupbox.cpp
index 5bdd6f20e6..a9b32ae065 100644
--- a/src/widgets/widgets/qgroupbox.cpp
+++ b/src/widgets/widgets/qgroupbox.cpp
@@ -194,10 +194,8 @@ QGroupBox::QGroupBox(QWidget *parent)
*/
QGroupBox::QGroupBox(const QString &title, QWidget *parent)
- : QWidget(*new QGroupBoxPrivate, parent, 0)
+ : QGroupBox(parent)
{
- Q_D(QGroupBox);
- d->init();
setTitle(title);
}
diff --git a/src/widgets/widgets/qkeysequenceedit.cpp b/src/widgets/widgets/qkeysequenceedit.cpp
index f8a3be366e..2fbc42330d 100644
--- a/src/widgets/widgets/qkeysequenceedit.cpp
+++ b/src/widgets/widgets/qkeysequenceedit.cpp
@@ -138,21 +138,17 @@ void QKeySequenceEditPrivate::finishEditing()
/*!
Constructs a QKeySequenceEdit widget with the given \a parent.
*/
-QKeySequenceEdit::QKeySequenceEdit(QWidget *parent) :
- QWidget(*new QKeySequenceEditPrivate, parent, 0)
+QKeySequenceEdit::QKeySequenceEdit(QWidget *parent)
+ : QKeySequenceEdit(*new QKeySequenceEditPrivate, parent, 0)
{
- Q_D(QKeySequenceEdit);
- d->init();
}
/*!
Constructs a QKeySequenceEdit widget with the given \a keySequence and \a parent.
*/
-QKeySequenceEdit::QKeySequenceEdit(const QKeySequence &keySequence, QWidget *parent) :
- QWidget(*new QKeySequenceEditPrivate, parent, 0)
+QKeySequenceEdit::QKeySequenceEdit(const QKeySequence &keySequence, QWidget *parent)
+ : QKeySequenceEdit(parent)
{
- Q_D(QKeySequenceEdit);
- d->init();
setKeySequence(keySequence);
}
diff --git a/src/widgets/widgets/qlabel.cpp b/src/widgets/widgets/qlabel.cpp
index 5db1013fd2..76713d9880 100644
--- a/src/widgets/widgets/qlabel.cpp
+++ b/src/widgets/widgets/qlabel.cpp
@@ -233,10 +233,8 @@ QLabel::QLabel(QWidget *parent, Qt::WindowFlags f)
\sa setText(), setAlignment(), setFrameStyle(), setIndent()
*/
QLabel::QLabel(const QString &text, QWidget *parent, Qt::WindowFlags f)
- : QFrame(*new QLabelPrivate(), parent, f)
+ : QLabel(parent, f)
{
- Q_D(QLabel);
- d->init();
setText(text);
}
diff --git a/src/widgets/widgets/qlcdnumber.cpp b/src/widgets/widgets/qlcdnumber.cpp
index 543a7aee11..2703e5d8a3 100644
--- a/src/widgets/widgets/qlcdnumber.cpp
+++ b/src/widgets/widgets/qlcdnumber.cpp
@@ -338,11 +338,8 @@ static const char *getSegments(char ch) // gets list of segments f
*/
QLCDNumber::QLCDNumber(QWidget *parent)
- : QFrame(*new QLCDNumberPrivate, parent)
+ : QLCDNumber(5, parent)
{
- Q_D(QLCDNumber);
- d->ndigits = 5;
- d->init();
}
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index e93ed11930..9e489fad14 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -260,10 +260,8 @@ void QLineEdit::initStyleOption(QStyleOptionFrame *option) const
\sa setText(), setMaxLength()
*/
QLineEdit::QLineEdit(QWidget* parent)
- : QWidget(*new QLineEditPrivate, parent,0)
+ : QLineEdit(QString(), parent)
{
- Q_D(QLineEdit);
- d->init(QString());
}
/*!
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index 8df083f75e..c03c96333a 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -1481,10 +1481,9 @@ QMenu::QMenu(QWidget *parent)
\sa title
*/
QMenu::QMenu(const QString &title, QWidget *parent)
- : QWidget(*new QMenuPrivate, parent, Qt::Popup)
+ : QMenu(parent)
{
Q_D(QMenu);
- d->init();
d->menuAction->setText(title);
}
diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp
index a3bb06c063..5608a4aff9 100644
--- a/src/widgets/widgets/qpushbutton.cpp
+++ b/src/widgets/widgets/qpushbutton.cpp
@@ -254,11 +254,9 @@ QPushButton::QPushButton(QWidget *parent)
*/
QPushButton::QPushButton(const QString &text, QWidget *parent)
- : QAbstractButton(*new QPushButtonPrivate, parent)
+ : QPushButton(parent)
{
- Q_D(QPushButton);
setText(text);
- d->init();
}
@@ -270,12 +268,10 @@ QPushButton::QPushButton(const QString &text, QWidget *parent)
*/
QPushButton::QPushButton(const QIcon& icon, const QString &text, QWidget *parent)
- : QAbstractButton(*new QPushButtonPrivate, parent)
+ : QPushButton(*new QPushButtonPrivate, parent)
{
- Q_D(QPushButton);
setText(text);
setIcon(icon);
- d->init();
}
/*! \internal
diff --git a/src/widgets/widgets/qradiobutton.cpp b/src/widgets/widgets/qradiobutton.cpp
index 55a584078a..284c5f56cf 100644
--- a/src/widgets/widgets/qradiobutton.cpp
+++ b/src/widgets/widgets/qradiobutton.cpp
@@ -155,10 +155,8 @@ QRadioButton::~QRadioButton()
*/
QRadioButton::QRadioButton(const QString &text, QWidget *parent)
- : QAbstractButton(*new QRadioButtonPrivate, parent)
+ : QRadioButton(parent)
{
- Q_D(QRadioButton);
- d->init();
setText(text);
}
diff --git a/src/widgets/widgets/qscrollbar.cpp b/src/widgets/widgets/qscrollbar.cpp
index 0490aa7bc8..79bfedb8c4 100644
--- a/src/widgets/widgets/qscrollbar.cpp
+++ b/src/widgets/widgets/qscrollbar.cpp
@@ -348,10 +348,8 @@ void QScrollBar::initStyleOption(QStyleOptionSlider *option) const
initial \l {QAbstractSlider::value} {value} of 0.
*/
QScrollBar::QScrollBar(QWidget *parent)
- : QAbstractSlider(*new QScrollBarPrivate, parent)
+ : QScrollBar(Qt::Vertical, parent)
{
- d_func()->orientation = Qt::Vertical;
- d_func()->init();
}
/*!
diff --git a/src/widgets/widgets/qslider.cpp b/src/widgets/widgets/qslider.cpp
index 7b675fccbd..744a43253a 100644
--- a/src/widgets/widgets/qslider.cpp
+++ b/src/widgets/widgets/qslider.cpp
@@ -284,10 +284,8 @@ QStyle::SubControl QSliderPrivate::newHoverControl(const QPoint &pos)
Constructs a vertical slider with the given \a parent.
*/
QSlider::QSlider(QWidget *parent)
- : QAbstractSlider(*new QSliderPrivate, parent)
+ : QSlider(Qt::Vertical, parent)
{
- d_func()->orientation = Qt::Vertical;
- d_func()->init();
}
/*!
diff --git a/src/widgets/widgets/qsplitter.cpp b/src/widgets/widgets/qsplitter.cpp
index e3ca6b0a79..3f1fa2d015 100644
--- a/src/widgets/widgets/qsplitter.cpp
+++ b/src/widgets/widgets/qsplitter.cpp
@@ -941,11 +941,8 @@ QSplitterLayoutStruct *QSplitterPrivate::insertWidget(int index, QWidget *w)
\sa setOrientation()
*/
QSplitter::QSplitter(QWidget *parent)
- : QFrame(*new QSplitterPrivate, parent)
+ : QSplitter(Qt::Horizontal, parent)
{
- Q_D(QSplitter);
- d->orient = Qt::Horizontal;
- d->init();
}
diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp
index 2e67276047..b93cefd867 100644
--- a/src/widgets/widgets/qtoolbar.cpp
+++ b/src/widgets/widgets/qtoolbar.cpp
@@ -520,10 +520,8 @@ QToolBar::QToolBar(QWidget *parent)
\sa setWindowTitle()
*/
QToolBar::QToolBar(const QString &title, QWidget *parent)
- : QWidget(*new QToolBarPrivate, parent, 0)
+ : QToolBar(parent)
{
- Q_D(QToolBar);
- d->init();
setWindowTitle(title);
}