I tried in Qt5.1 and it's working. Thanks.
2013/10/2 Дмитрий Козлов <gni...@mail.ru> > 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 > listInterest@qt-project.orghttp://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 > >
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest