aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2023-04-16 15:48:36 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2023-04-18 01:23:02 +0200
commit75a45dfbbf499641bd68ae4d719ffb83d9072882 (patch)
treed502fb73692b9343368657502db9e5144a253f6c /src/quick/items
parent0d858dd08b10b79fca67f7f3defc46ab68bcf7fa (diff)
De-inline QQuickItemChangeListener destructor and export class
With all virtuals inline, every module that has types deriving from this class will have their own vtable for it, which is both unnecessary and dangerous if we want to dynamic_cast from or two this type. By de-inlining the destructor we pin the vtable of the class to QtQuick. Pick-to: 6.5 Change-Id: Iaf83a1d7391e73992a44d5cd651b0194ea43d31c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/quick/items')
-rw-r--r--src/quick/items/qquickitem.cpp3
-rw-r--r--src/quick/items/qquickitemchangelistener_p.h6
2 files changed, 6 insertions, 3 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index ba161f5b27..e2d6bad149 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -9808,6 +9808,9 @@ QPointF QQuickItem::mapToGlobal(qreal x, qreal y) const
QPointF QQuickItem::mapFromGlobal(qreal x, qreal y) const
{ return mapFromGlobal(QPointF(x, y)); }
+//! \internal
+QQuickItemChangeListener::~QQuickItemChangeListener() = default;
+
QT_END_NAMESPACE
#include <moc_qquickitem.cpp>
diff --git a/src/quick/items/qquickitemchangelistener_p.h b/src/quick/items/qquickitemchangelistener_p.h
index 57bbf77f70..a6b8da1988 100644
--- a/src/quick/items/qquickitemchangelistener_p.h
+++ b/src/quick/items/qquickitemchangelistener_p.h
@@ -15,7 +15,7 @@
// We mean it.
//
-#include <QtCore/private/qglobal_p.h>
+#include <QtQuick/private/qtquickglobal_p.h>
QT_BEGIN_NAMESPACE
@@ -81,10 +81,10 @@ private:
#define QT_QUICK_NEW_GEOMETRY_CHANGED_HANDLING
-class QQuickItemChangeListener
+class Q_QUICK_PRIVATE_EXPORT QQuickItemChangeListener
{
public:
- virtual ~QQuickItemChangeListener() {}
+ virtual ~QQuickItemChangeListener();
virtual void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF & /* oldGeometry */) {}
virtual void itemSiblingOrderChanged(QQuickItem *) {}