Hi,

Why can't i use the above statement within my Map in qml? This:
>
>  Map {
>    Connections {
>         target: LocationProvider
>         onPositionUpdated: console.log("Position changed")
>     }
>  }
>
> results in "Cannot assign object to list
>         Connections {
> "
>
> while i can do the same with a real qml object


What happens is that "real qml objects" are subclasses of QDeclarativeItem,
and QDeclarativeItem has a default property named "children". So to be able
to put a Connections object inside your Map object, you must add a
Q_PROPERTY to your Map class that takes a list of QDeclarativeConnections
(or more generally, a list of QDeclarativeItem, or even of QOBjects, if you
wish), and make this property as default.

-- 
Gregory Schlomoff
http://www.gregschlom.com
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-qml

Reply via email to