diff options
-rw-r--r-- | src/corelib/kernel/qobject.h | 6 | ||||
-rw-r--r-- | tests/auto/corelib/kernel/qobject/tst_qobject.cpp | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index 7f72b69c1a..240ace1e27 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -77,6 +77,9 @@ class QRegExp; #if QT_CONFIG(regularexpression) class QRegularExpression; #endif +#if !QT_DEPRECATED_SINCE(5, 14) || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +# define QT_NO_USERDATA +#endif #ifndef QT_NO_USERDATA class QObjectUserData; #endif @@ -405,8 +408,11 @@ public: #endif // QT_NO_PROPERTIES #ifndef QT_NO_USERDATA + QT_DEPRECATED_VERSION_5_14 static uint registerUserData(); + QT_DEPRECATED_VERSION_X_5_14("Use setProperty()") void setUserData(uint id, QObjectUserData* data); + QT_DEPRECATED_VERSION_X_5_14("Use property()") QObjectUserData* userData(uint id) const; #endif // QT_NO_USERDATA diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index 7c9d8a476a..1778bf24bc 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -81,7 +81,9 @@ private slots: void senderTest(); void declareInterface(); void qpointerResetBeforeDestroyedSignal(); +#ifndef QT_NO_USERDATA void testUserData(); +#endif void childDeletesItsSibling(); void dynamicProperties(); void floatProperty(); @@ -2338,6 +2340,7 @@ void tst_QObject::declareInterface() } +#ifndef QT_NO_USERDATA class CustomData : public QObjectUserData { public: @@ -2380,6 +2383,7 @@ void tst_QObject::testUserData() QCOMPARE(data->id, id); } } +#endif // QT_NO_USERDATA class DestroyedListener : public QObject { |