[Qt-interest] Using typedef'ed custom type as Q_PROPERTY

Andras Toth parrotfortytwo at gmail.com
Fri Aug 28 13:49:22 CEST 2009


Thanks for making that clear. The problem is, however, that if the
type ID is not registered, a runtime warning is issued:

QMetaProperty::read: Unable to handle unregistered datatype 'ID' for
property 'Cat::id'

and indeed, the property setting and querying does not work for this value.

Is there a workaround for this, or can we state that it is impossible
to use typedef'ed types as properties in Qt?

On Thu, Aug 27, 2009 at 5:50 PM, Thiago
Macieira<thiago.macieira at trolltech.com> wrote:
> Em Quinta-feira 27 Agosto 2009, às 16:06:52, Andras Toth escreveu:
>> Hello, I have been trying all day to use a typedef'ed custom variable
>> as Q_PROPERTY, however, it seems impossible to read and write this
>> value through methods property(const char*) and setProperty(const
>> char*, const QVariant &)
>>
>
> A meta type can only be registered once. Your type (int) is already
> registered, so you can't register the typedef again.
>
> --
> Thiago Macieira - thiago.macieira (AT) nokia.com
>  Senior Product Manager - Nokia, Qt Development Frameworks
>     Sandakerveien 116, NO-0402 Oslo, Norway
>
> Qt Developer Days 2009 | Registration Now Open!
> Munich, Germany: Oct 12 - 14     San Francisco, California: Nov 2 - 4
>      http://qt.nokia.com/qtdevdays2009
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>




More information about the Qt-interest-old mailing list