[Interest] Custom Quick view to visualize a List-model of points on a map
Ola Røer Thorsen
ola at silentwings.no
Sun Sep 29 13:49:40 CEST 2013
Ah! Thank you, exactly what I was looking for!
Best regards,
Ola
(Sendt fra mobiltelefon)
> Den 28. sep. 2013 kl. 16:47 skrev Дмитрий Козлов <gnitry at 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 at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>
> _______________________________________________
> 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/20130929/d9a069dd/attachment.html>
More information about the Interest
mailing list