diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2019-06-26 17:41:59 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-06-29 16:10:01 +0200 |
commit | a27e7e815175bc9417aaf7377b349109afd235e4 (patch) | |
tree | 134be19ba25aca210711de855d88f4c2d1b73e1f /src/corelib | |
parent | 56962604254a31d5d54ea41044a5c251ff27fa0c (diff) |
QObject: deprecate the undocumented userData() feature
... and schedule it for removal in Qt 6.
This appears to have come to some fame on the internet, so better add
a deprecation warning before we remove it in Qt 6.
Change-Id: I42d91d933f47dfd2d8d54c92358e9e46ced6bf21
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/kernel/qobject.h | 6 |
1 files changed, 6 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 |