[Interest] Custom Quick view to visualize a List-model of points on a map
Дмитрий Козлов
gnitry at mail.ru
Sat Sep 28 16:47:16 CEST 2013
27.09.2013 17:22, Ola Røer Thorsen пишет:
> Hi,
>
> I have a c++ list model that inherits QAbstractListModel. It contains
> a list of waypoints that amongst other things have x,y screen
> coordinates. Points are added, removed and values are changed runtime.
>
> I want to visualize these in Quick2 on top of a map image. I need to
> create Quick Items mapped to the items in the list model, bind
> properties, and remove the items when they are removed from the list.
> Similar to a ListView, just more for displaying something on a map.
> Any hints on how to do this?
>
>
>
>
> You can add "itemX", "itemY" roles to C++ list model items and then
> use them in QtQuick Repeater's delegate.
> Something like this:
>
> Image {
> id: map
> }
>
> Repeater {
> anchors.fill: map
> model: myModel
> delegate: Rectangle {
> x: itemX
> y: itemY
>
> }
> }
>
>
> _______________________________________________
> 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/20130928/8d3a4a3e/attachment.html>
More information about the Interest
mailing list