Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

About using an undocumented class in Qt

Tags:

c++

qt

qt4

Is it safe to use the undocumented QObjectUserData class and the QObject::setUserData in Qt?

like image 483
mmonem Avatar asked Nov 24 '11 17:11

mmonem


2 Answers

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.

like image 90
Silas Parker Avatar answered Sep 20 '22 10:09

Silas Parker


In general you should not rely upon undocumented APIs. If you ever plan on upgrading Qt, then don't use it!

like image 33
Will Bickford Avatar answered Sep 19 '22 10:09

Will Bickford