02.10.2013 19:18, Stephen Kelly пишет:
On Wednesday, October 02, 2013 19:02:54 Дмитрий Козлов wrote:
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.
This will work with QML with Qt 5.2.
https://codereview.qt-project.org/#change,42703
Before that, your Q_PROPERTY needs to be type QObject*.
Thanks,
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest
Yes. Didn't try in Qt 5. But in Qt 4.8.5 I use
/Q_PROPERTY(QObject * myObject READ myObject)/
and dynamic_cast in "set"-method.
PS: /Q_PROPERTY(MyObject * myObject READ myObject)///works, if MyObject
derived from QAbstractListModel
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest