Hi Paul,

On Fri, Oct 11, 2013 at 5:29 PM, Paul Lemire <[email protected]> wrote:
> On a side note, those models are not registered as qml properties but are
> returned as QObject* in a Q_INVOKABLE methods of the backend. If I want to
> use the model in a ListView, I then do :
>
> ListView
> {
>         model : library_name.getMyModel();
>         ....
> }
When returning QObject* from invokable methods, the Qml engine takes
ownership by default. Your object probably gets destroyed at some
point.

Use QQmlEngine::setObjectOwnership if this is not what you want.

Why aren't you providing your model pointers as read only properties instead?

Nils
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to