[Qt-interest] Use myClass* with QMetaProperty

Ender EREL erelender at yahoo.com
Fri Dec 19 11:05:23 CET 2008


Rohan McGovern wrote:
> 
> Hi,
> 
> 
> You need to _register_ the datatype, not just declare it.  They are 
> not quite the same.
> 
> i.e., you need both Q_DECLARE_METATYPE and qRegisterMetatype.
> 
> http://doc.trolltech.com/4.5/qmetatype.html#qRegisterMetaType-2
> 

Hello again,

Thanks for the help, it is much appreciated.

qRegisterMetaType documentation tells that Q_DECLARE_METATYPE is 
sufficient to use Type T in QVariant, therefore i assumed that it would 
also be sufficient to use the type in property() & setProperty().

Perhaps it might be helpful to add to the documentation that custom 
classes need to be registered to use with reflection, i couldn't find 
any info about this issue.

Again, thank you for the answer.

Best regards.

-- 
ender



More information about the Qt-interest-old mailing list