Is it safe to use the undocumented QObjectUserData
class and the QObject::setUserData
in Qt?
Instead you could look at using QObject::setProperty
, this allows you to set not only compile time declared properties, but also dynamic properties which do not need to be declared before use. This allows you to attach arbitrary values to QObjects at run time, similar to user data.
In general you should not rely upon undocumented APIs. If you ever plan on upgrading Qt, then don't use it!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With