[Interest] Passing QML mapobjects (MapCircle) to QML maps through C++
Kishore J
kitts.mailinglists at gmail.com
Sun Aug 14 13:12:15 CEST 2016
Hi,
Due to the lack of C++ API for maps, i am forced to use QML for the map but
i am unable to understand how i need to structure my application.
Architecturally, I have a qobject pool and various applications register
objects to the pool. Any part of the application that can use the pooled
object use it.
In this scenario, i have some plugins that would pass map objects (or map
object factories) to the pool. Then i have one or more maps that take the
registered map object and show it on it's map.
Since maps only work in QML, it is not clear to me how to achieve this. I
have successfully created a MapWidget which basically inherits QQuickWidget
along with a qml file that contains the following code.
/**************************/
import QtQuick 2.5
import QtLocation 5.6
Map {
id: map
zoomLevel: (maximumZoomLevel - minimumZoomLevel)/2
plugin: Plugin {
name: "here"
PluginParameter { name: "here.app_id"; value: "xxxxx" }
PluginParameter { name: "here.token"; value: "xxxxx" }
}
activeMapType: supportedMapTypes[3]
MapCircle {
id: circle
center {
latitude: 10
longitude: 20
}
radius: 500.0
color: 'black'
opacity: .5
border.width: 1
}
Component.onCompleted:{
for(var i = 0; i < supportedMapTypes.length; ++i)
console.debug(i + ' ' + supportedMapTypes[i].name);
}
}
/**************************/
As such I have almost no experience with QML and getting the above QML file
to work was a task in itself for me. I am comfortable with C++ side of
things.
I would really appreciate it if someone could hand hold me here. I
understand that every MapObject that is created would need QML code again
but I think i can deal with that. The map objects need not always be
circles and could possibly be more complex qml code.
--
Regards,
Kishore
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160814/17206098/attachment.html>
More information about the Interest
mailing list