diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2013-07-12 13:22:28 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2013-07-12 13:49:21 +0300 |
commit | 260593c8c54c1130a513bbf85b053292ae5ea4c7 (patch) | |
tree | 063c14d183dac2016548fdc5c39e35e1778c9096 /examples/qmlmaps/qml/qmlmaps/main.qml | |
parent | 308b3c4754f0d3231a9b5a3adbafb1b477d5a858 (diff) |
Bring new data proxies to maps
Maps now has the basic QMapDataProxy and the specialized
QItemModelMapDataProxy to choose from.
Removed the last vestiges of old QDataSet and related classes.
Bunch of misc fixes also included.
Change-Id: I3993ac2a669b818f89bd771ea9dc8b7e458c4b8c
Reviewed-by: Mika Salmela <mika.salmela@digia.com>
Diffstat (limited to 'examples/qmlmaps/qml/qmlmaps/main.qml')
-rw-r--r-- | examples/qmlmaps/qml/qmlmaps/main.qml | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/examples/qmlmaps/qml/qmlmaps/main.qml b/examples/qmlmaps/qml/qmlmaps/main.qml index cfa98d3a..d546d3a5 100644 --- a/examples/qmlmaps/qml/qmlmaps/main.qml +++ b/examples/qmlmaps/qml/qmlmaps/main.qml @@ -41,29 +41,20 @@ Item { visible: false } - DataItem { - id: testitem1 - label: "dB" - value: 76 - position: "95.0, 490.0" + MapDataMapping { + id: mapMapping + labelRole: "label" + valueRole: "value" + xPosRole: "xPos" + yPosRole: "yPos" } - DataItem { - id: testitem2 - label: "dB" - value: 88 - position: "185.0, 105.0" - } - DataItem { - id: testitem3 - label: "dB" - value: 85 - position: "700.0, 465.0" - } - DataItem { - id: testitem4 - label: "dB" - value: 92 - position: "505.0, 225.0" + + ListModel { + id: dataModel + ListElement{ label: "dB"; value: 76; xPos: 95.0; yPos: 490.0 } + ListElement{ label: "dB"; value: 88; xPos: 185.0; yPos: 105.0 } + ListElement{ label: "dB"; value: 85; xPos: 700.0; yPos: 465.0 } + ListElement{ label: "dB"; value: 92; xPos: 505.0; yPos: 225.0 } } Maps3D { @@ -71,6 +62,7 @@ Item { width: dataView.width height: dataView.height fontSize: 300.0 + mapping: mapMapping Component.onCompleted: { console.log("testmap complete"); @@ -84,10 +76,7 @@ Item { shadowQuality = Maps3D.ShadowNone selectionMode = Maps3D.ModeBar labelTransparency = Maps3D.TransparencyNoBackground//.TransparencyFromTheme - addDataItem(testitem1); - addDataItem(testitem2); - addDataItem(testitem3); - addDataItem(testitem4); + data = dataModel } } } |