QtWidgets: de-inline some more virtual dtors

Helps pinning the vtable to a single TU, which can
prevent false negative RTTI (incl. dynamic_cast and
catch()).

But mostly because it's rather pointless to have dtors
of polymophic function inline. Most of the time, the
code will be called through the vtable indirection,
anyway (which also means that an out-of-line copy of
the code needs to exist in any case). The inline
method will only be used when the compiler can prove
the dynamic type of an object.

Saves ~1.5KiB in text size on optimized GCC 4.9 Linux
AMD64 builds.

Change-Id: Ic4ce96da559252c8abc29d880530c84035db2306
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Marc Mutz 2015-12-18 12:58:28 +01:00
parent 11c8823ff7
commit 7facc281e5
6 changed files with 24 additions and 1 deletions

View File

@ -80,6 +80,11 @@ static inline int themeDialogType(const QDialog *dialog)
return -1;
}
QDialogPrivate::~QDialogPrivate()
{
delete m_platformHelper;
}
QPlatformDialogHelper *QDialogPrivate::platformHelper() const
{
// Delayed creation of the platform, ensuring that

View File

@ -70,7 +70,7 @@ public:
rescode(0), resetModalityTo(-1), wasModalitySet(true), eventLoop(0),
nativeDialogInUse(false), m_platformHelper(0), m_platformHelperCreated(false)
{}
~QDialogPrivate() { delete m_platformHelper; }
~QDialogPrivate();
QWindow *parentWindow() const;
bool setNativeDialogVisible(bool visible);

View File

@ -1018,6 +1018,15 @@ QPixmapColorizeFilter::QPixmapColorizeFilter(QObject *parent)
d->alphaBlend = false;
}
/*!
\internal
*/
QPixmapColorizeFilter::~QPixmapColorizeFilter()
{
// was inline until Qt 5.6, so essentially
// must stay empty until ### Qt 6
}
/*!
Gets the color of the colorize filter.

View File

@ -142,6 +142,7 @@ class Q_WIDGETS_EXPORT QPixmapColorizeFilter : public QPixmapFilter
public:
QPixmapColorizeFilter(QObject *parent = 0);
~QPixmapColorizeFilter();
void setColor(const QColor& color);
QColor color() const;

View File

@ -202,6 +202,13 @@ QGraphicsProxyWidgetPrivate::QGraphicsProxyWidgetPrivate()
{
}
/*!
\internal
*/
QGraphicsProxyWidgetPrivate::~QGraphicsProxyWidgetPrivate()
{
}
/*!
\internal
*/

View File

@ -57,6 +57,7 @@ class QGraphicsProxyWidgetPrivate : public QGraphicsWidgetPrivate
Q_DECLARE_PUBLIC(QGraphicsProxyWidget)
public:
QGraphicsProxyWidgetPrivate();
~QGraphicsProxyWidgetPrivate();
void init();
void sendWidgetMouseEvent(QGraphicsSceneMouseEvent *event);