Disable copies in QObjectData / QObjectUserData

They're meant to be subclassed, so we need to avoid slicing.

Change-Id: I384b65478f728c69aaf1edbc985b3fb4150191fe
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
Giuseppe D'Angelo 2019-05-13 14:52:28 +02:00 committed by Marc Mutz
parent 2e83528856
commit eb8b63542f
2 changed files with 15 additions and 0 deletions

View File

@ -173,6 +173,12 @@ int (*QAbstractDeclarativeData::receivers)(QAbstractDeclarativeData *, const QO
bool (*QAbstractDeclarativeData::isSignalConnected)(QAbstractDeclarativeData *, const QObject *, int) = 0; bool (*QAbstractDeclarativeData::isSignalConnected)(QAbstractDeclarativeData *, const QObject *, int) = 0;
void (*QAbstractDeclarativeData::setWidgetParent)(QObject *, QObject *) = 0; void (*QAbstractDeclarativeData::setWidgetParent)(QObject *, QObject *) = 0;
/*!
\fn QObjectData::QObjectData()
\internal
*/
QObjectData::~QObjectData() {} QObjectData::~QObjectData() {}
QMetaObject *QObjectData::dynamicMetaObject() const QMetaObject *QObjectData::dynamicMetaObject() const
@ -4168,6 +4174,11 @@ uint QObject::registerUserData()
return user_data_registration++; return user_data_registration++;
} }
/*!
\fn QObjectUserData::QObjectUserData()
\internal
*/
/*! /*!
\internal \internal
*/ */

View File

@ -93,7 +93,9 @@ Q_CORE_EXPORT void qt_qFindChildren_helper(const QObject *parent, const QRegular
Q_CORE_EXPORT QObject *qt_qFindChild_helper(const QObject *parent, const QString &name, const QMetaObject &mo, Qt::FindChildOptions options); Q_CORE_EXPORT QObject *qt_qFindChild_helper(const QObject *parent, const QString &name, const QMetaObject &mo, Qt::FindChildOptions options);
class Q_CORE_EXPORT QObjectData { class Q_CORE_EXPORT QObjectData {
Q_DISABLE_COPY(QObjectData)
public: public:
QObjectData() = default;
virtual ~QObjectData() = 0; virtual ~QObjectData() = 0;
QObject *q_ptr; QObject *q_ptr;
QObject *parent; QObject *parent;
@ -472,7 +474,9 @@ inline const QMetaObject *qt_getQtMetaObject() noexcept
#ifndef QT_NO_USERDATA #ifndef QT_NO_USERDATA
class Q_CORE_EXPORT QObjectUserData { class Q_CORE_EXPORT QObjectUserData {
Q_DISABLE_COPY(QObjectUserData)
public: public:
QObjectUserData() = default;
virtual ~QObjectUserData(); virtual ~QObjectUserData();
}; };
#endif #endif