[Interest] Pointers as Q_PPOPERTY
gnitry at mail.ru
Wed Oct 2 17:02:54 CEST 2013
02.10.2013 18:12, Николай Шатохин пишет:
> I registered as QML Type class Ship inherited from QObject that have
> Q_PROPERTY(Hull hull READ hull)
> Q_PROPERTY(Reactor reactor READ reactor)
> Q_PROPERTY(Shields shields READ shields)
> (all field classes inherited from QObject too)
> But in ship class I'm using this fields as pointers (Hull * hull). So,
> how to use correctly Q_Properties in this case? (I need call methods
> from this fields and catch signals from them in QML)
> Can I use something like this Q_PROPERTY(Hull hull READ hull)?
> And then in QML:
> id: ship
> id: hull_indicator
> backend: ship.hull
> Best regards,
> Interest mailing list
> Interest at qt-project.org
Maybe you looking for this (work with pointers) ?
Q_PROPERTY(Hull * hull READ hull)
Q_PROPERTY(Reactor * reactor READ reactor)
Q_PROPERTY(Shields * shields READ shields)
This approach should work in your case.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest