Re: [Interest] Custom Quick view to visualize a List-model of points on a map

2013-09-29 Thread Ola Røer Thorsen
Ah! Thank you, exactly what I was looking for! 

Best regards,
Ola

(Sendt fra mobiltelefon)

 Den 28. sep. 2013 kl. 16:47 skrev Дмитрий Козлов gni...@mail.ru:
 
 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@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
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Custom Quick view to visualize a List-model of points on a map

2013-09-28 Thread Дмитрий Козлов

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@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


[Interest] Custom Quick view to visualize a List-model of points on a map

2013-09-27 Thread 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?
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest