diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2012-10-22 08:30:32 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-06 12:40:55 +0100 |
commit | 9d95bc58e82c65527a364906eca740151fe3301b (patch) | |
tree | 78b85f2c8fc2863bb973a8ed091e5b9a45cc84a2 /src/widgets/widgets | |
parent | 65755f9a68947e774c640ce92c022d677acdcc4a (diff) |
De-inline some destructors in QtWidgets
Destructors should be out-of-line so that the compiler doesn't generate
one per translation unit.
Apart from creating more work for the compiler, it can also lead to
duplicated vtables if the dtor is the first virtual function
(reimplementation), and all other virtuals are inline, too.
Duplicate vtables then break RTTI.
In addition, having virtual dtors de-inlined allows us to add code
to them in a BC way.
As a final argument, this change may lead to less code app-side, since
a sequence of cross-DLL calls (to member variable dtors) is replaced
by a single cross-DLL call to the new out-of-line dtor.
Change-Id: Ifb8c4aa992c75d61ba9ac8de5ab41d1e96b0a0b1
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r-- | src/widgets/widgets/qcheckbox.cpp | 7 | ||||
-rw-r--r-- | src/widgets/widgets/qcheckbox.h | 2 | ||||
-rw-r--r-- | src/widgets/widgets/qcommandlinkbutton.cpp | 7 | ||||
-rw-r--r-- | src/widgets/widgets/qcommandlinkbutton.h | 1 | ||||
-rw-r--r-- | src/widgets/widgets/qdatetimeedit.cpp | 21 | ||||
-rw-r--r-- | src/widgets/widgets/qdatetimeedit.h | 3 | ||||
-rw-r--r-- | src/widgets/widgets/qprogressbar.cpp | 7 | ||||
-rw-r--r-- | src/widgets/widgets/qprogressbar.h | 1 | ||||
-rw-r--r-- | src/widgets/widgets/qradiobutton.cpp | 7 | ||||
-rw-r--r-- | src/widgets/widgets/qradiobutton.h | 1 | ||||
-rw-r--r-- | src/widgets/widgets/qspinbox.cpp | 9 | ||||
-rw-r--r-- | src/widgets/widgets/qspinbox.h | 2 | ||||
-rw-r--r-- | src/widgets/widgets/qsplitter.cpp | 7 | ||||
-rw-r--r-- | src/widgets/widgets/qsplitter.h | 1 |
14 files changed, 75 insertions, 1 deletions
diff --git a/src/widgets/widgets/qcheckbox.cpp b/src/widgets/widgets/qcheckbox.cpp index 29ac80c77d..bf6593d976 100644 --- a/src/widgets/widgets/qcheckbox.cpp +++ b/src/widgets/widgets/qcheckbox.cpp @@ -216,6 +216,13 @@ QCheckBox::QCheckBox(const QString &text, QWidget *parent) setText(text); } +/*! + Destructor. +*/ +QCheckBox::~QCheckBox() +{ +} + void QCheckBox::setTristate(bool y) { Q_D(QCheckBox); diff --git a/src/widgets/widgets/qcheckbox.h b/src/widgets/widgets/qcheckbox.h index c7f33b933a..468c8717c7 100644 --- a/src/widgets/widgets/qcheckbox.h +++ b/src/widgets/widgets/qcheckbox.h @@ -61,7 +61,7 @@ class Q_WIDGETS_EXPORT QCheckBox : public QAbstractButton public: explicit QCheckBox(QWidget *parent=0); explicit QCheckBox(const QString &text, QWidget *parent=0); - + ~QCheckBox(); QSize sizeHint() const; QSize minimumSizeHint() const; diff --git a/src/widgets/widgets/qcommandlinkbutton.cpp b/src/widgets/widgets/qcommandlinkbutton.cpp index 5207241b84..11c4b411f0 100644 --- a/src/widgets/widgets/qcommandlinkbutton.cpp +++ b/src/widgets/widgets/qcommandlinkbutton.cpp @@ -302,6 +302,13 @@ QCommandLinkButton::QCommandLinkButton(const QString &text, const QString &descr d->init(); } +/*! + Destructor. +*/ +QCommandLinkButton::~QCommandLinkButton() +{ +} + /*! \reimp */ bool QCommandLinkButton::event(QEvent *e) { diff --git a/src/widgets/widgets/qcommandlinkbutton.h b/src/widgets/widgets/qcommandlinkbutton.h index 50707d82fc..ec8fd339d0 100644 --- a/src/widgets/widgets/qcommandlinkbutton.h +++ b/src/widgets/widgets/qcommandlinkbutton.h @@ -62,6 +62,7 @@ public: explicit QCommandLinkButton(QWidget *parent=0); explicit QCommandLinkButton(const QString &text, QWidget *parent=0); explicit QCommandLinkButton(const QString &text, const QString &description, QWidget *parent=0); + ~QCommandLinkButton(); QString description() const; void setDescription(const QString &description); diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp index 8a23530283..0895c96577 100644 --- a/src/widgets/widgets/qdatetimeedit.cpp +++ b/src/widgets/widgets/qdatetimeedit.cpp @@ -219,6 +219,13 @@ QDateTimeEdit::QDateTimeEdit(const QVariant &var, QVariant::Type parserType, QWi } /*! + Destructor. +*/ +QDateTimeEdit::~QDateTimeEdit() +{ +} + +/*! \property QDateTimeEdit::dateTime \brief the QDateTime that is set in the QDateTimeEdit @@ -1562,6 +1569,13 @@ QTimeEdit::QTimeEdit(const QTime &time, QWidget *parent) } /*! + Destructor. +*/ +QTimeEdit::~QTimeEdit() +{ +} + +/*! \property QTimeEdit::time \internal \sa QDateTimeEdit::time @@ -1631,6 +1645,13 @@ QDateEdit::QDateEdit(const QDate &date, QWidget *parent) } /*! + Destructor. +*/ +QDateEdit::~QDateEdit() +{ +} + +/*! \property QDateEdit::date \internal \sa QDateTimeEdit::date diff --git a/src/widgets/widgets/qdatetimeedit.h b/src/widgets/widgets/qdatetimeedit.h index 77e038cab8..7435013bec 100644 --- a/src/widgets/widgets/qdatetimeedit.h +++ b/src/widgets/widgets/qdatetimeedit.h @@ -100,6 +100,7 @@ public: explicit QDateTimeEdit(const QDateTime &dt, QWidget *parent = 0); explicit QDateTimeEdit(const QDate &d, QWidget *parent = 0); explicit QDateTimeEdit(const QTime &t, QWidget *parent = 0); + ~QDateTimeEdit(); QDateTime dateTime() const; QDate date() const; @@ -209,6 +210,7 @@ class Q_WIDGETS_EXPORT QTimeEdit : public QDateTimeEdit public: explicit QTimeEdit(QWidget *parent = 0); explicit QTimeEdit(const QTime &time, QWidget *parent = 0); + ~QTimeEdit(); Q_SIGNALS: void userTimeChanged(const QTime &time); @@ -221,6 +223,7 @@ class Q_WIDGETS_EXPORT QDateEdit : public QDateTimeEdit public: explicit QDateEdit(QWidget *parent = 0); explicit QDateEdit(const QDate &date, QWidget *parent = 0); + ~QDateEdit(); Q_SIGNALS: void userDateChanged(const QDate &date); diff --git a/src/widgets/widgets/qprogressbar.cpp b/src/widgets/widgets/qprogressbar.cpp index b7726e7771..2bd893003d 100644 --- a/src/widgets/widgets/qprogressbar.cpp +++ b/src/widgets/widgets/qprogressbar.cpp @@ -244,6 +244,13 @@ QProgressBar::QProgressBar(QWidget *parent) } /*! + Destructor. +*/ +QProgressBar::~QProgressBar() +{ +} + +/*! Reset the progress bar. The progress bar "rewinds" and shows no progress. */ diff --git a/src/widgets/widgets/qprogressbar.h b/src/widgets/widgets/qprogressbar.h index 30a4863f84..a830df7a57 100644 --- a/src/widgets/widgets/qprogressbar.h +++ b/src/widgets/widgets/qprogressbar.h @@ -73,6 +73,7 @@ public: enum Direction { TopToBottom, BottomToTop }; explicit QProgressBar(QWidget *parent = 0); + ~QProgressBar(); int minimum() const; int maximum() const; diff --git a/src/widgets/widgets/qradiobutton.cpp b/src/widgets/widgets/qradiobutton.cpp index 78d53ad0e6..d4abd3389f 100644 --- a/src/widgets/widgets/qradiobutton.cpp +++ b/src/widgets/widgets/qradiobutton.cpp @@ -144,6 +144,13 @@ QRadioButton::QRadioButton(QWidget *parent) } /*! + Destructor. +*/ +QRadioButton::~QRadioButton() +{ +} + +/*! Constructs a radio button with the given \a parent and a \a text string. The \a parent argument is passed on to the QAbstractButton constructor. diff --git a/src/widgets/widgets/qradiobutton.h b/src/widgets/widgets/qradiobutton.h index eeb029871c..dec49dd090 100644 --- a/src/widgets/widgets/qradiobutton.h +++ b/src/widgets/widgets/qradiobutton.h @@ -59,6 +59,7 @@ class Q_WIDGETS_EXPORT QRadioButton : public QAbstractButton public: explicit QRadioButton(QWidget *parent=0); explicit QRadioButton(const QString &text, QWidget *parent=0); + ~QRadioButton(); QSize sizeHint() const; QSize minimumSizeHint() const; diff --git a/src/widgets/widgets/qspinbox.cpp b/src/widgets/widgets/qspinbox.cpp index 6a11c6d88c..cb09e8bb32 100644 --- a/src/widgets/widgets/qspinbox.cpp +++ b/src/widgets/widgets/qspinbox.cpp @@ -209,6 +209,10 @@ QSpinBox::QSpinBox(QWidget *parent) d->init(); } +/*! + Destructor. +*/ +QSpinBox::~QSpinBox() {} /*! \property QSpinBox::value @@ -580,6 +584,11 @@ QDoubleSpinBox::QDoubleSpinBox(QWidget *parent) } /*! + Destructor. +*/ +QDoubleSpinBox::~QDoubleSpinBox() {} + +/*! \property QDoubleSpinBox::value \brief the value of the spin box diff --git a/src/widgets/widgets/qspinbox.h b/src/widgets/widgets/qspinbox.h index b9475254db..889b283c2a 100644 --- a/src/widgets/widgets/qspinbox.h +++ b/src/widgets/widgets/qspinbox.h @@ -66,6 +66,7 @@ class Q_WIDGETS_EXPORT QSpinBox : public QAbstractSpinBox public: explicit QSpinBox(QWidget *parent = 0); + ~QSpinBox(); int value() const; @@ -124,6 +125,7 @@ class Q_WIDGETS_EXPORT QDoubleSpinBox : public QAbstractSpinBox Q_PROPERTY(double value READ value WRITE setValue NOTIFY valueChanged USER true) public: explicit QDoubleSpinBox(QWidget *parent = 0); + ~QDoubleSpinBox(); double value() const; diff --git a/src/widgets/widgets/qsplitter.cpp b/src/widgets/widgets/qsplitter.cpp index 18724cab19..70c493cedd 100644 --- a/src/widgets/widgets/qsplitter.cpp +++ b/src/widgets/widgets/qsplitter.cpp @@ -124,6 +124,13 @@ QSplitterHandle::QSplitterHandle(Qt::Orientation orientation, QSplitter *parent) } /*! + Destructor. +*/ +QSplitterHandle::~QSplitterHandle() +{ +} + +/*! Sets the orientation of the splitter handle to \a orientation. This is usually propagated from the QSplitter. diff --git a/src/widgets/widgets/qsplitter.h b/src/widgets/widgets/qsplitter.h index 147fcff0ff..2bcdc54c0e 100644 --- a/src/widgets/widgets/qsplitter.h +++ b/src/widgets/widgets/qsplitter.h @@ -141,6 +141,7 @@ class Q_WIDGETS_EXPORT QSplitterHandle : public QWidget Q_OBJECT public: explicit QSplitterHandle(Qt::Orientation o, QSplitter *parent); + ~QSplitterHandle(); void setOrientation(Qt::Orientation o); Qt::Orientation orientation() const; |