[Interest] Pointers as Q_PPOPERTY
Николай Шатохин
n.shatokhin at gmail.com
Wed Oct 2 18:08:24 CEST 2013
I tried in Qt5.1 and it's working. Thanks.
2013/10/2 Дмитрий Козлов <gnitry at 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 at 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 at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131002/d441f934/attachment.html>
More information about the Interest
mailing list