[Development] Qt5.3 / Location Maps
Aaron McCarthy
mccarthy.aaron at gmail.com
Wed May 7 02:41:54 CEST 2014
Hi,
On Tue, 6 May 2014 15:59:59 Kate Alhola wrote:
> Hi, i have been doing application that uses maps. Application UI is Qml but
> all data is generated on C++ side and once again, thee basic issue, is
> there any way to add items from C++ to Qml map.
>
> I used Qt4.8 and there was basically same issue, there was no way to add
> any C++ generated stuff on Qml map, no any way to add QGeoMapObject etc to
> Qml map. I resolved this issue by making own QML wrapper
> around QGraphicsGeoMap that accepts C++ classes.
>
> Then when i switched to Qt5.3, there was no maps at all, I ported Qt4.8
> maps to Qt5.3 QtQuick1 and that works nicely. I also noticed that it can't
> be ported to QtQuick2 because old maps depend on QGraphicsView.
>
> Now I checked Qt5.3 location maps with qt3d . All fine, it copmpiles and
> run but alsp all C++ API is gone and there is still no way to add items
> from C++ to map. Even all QGeoMapObjects are gone.
The Maps C++ API was removed from the public API during the initial porting to
Qt5. This was done because we didn't want to be tied to a C++ API that we were
not 100% satisfied with and to focus limited developer resources on the
QtQuick2 implementation.
For the time being the best way to place a large number of similar items on a
map from C++ is to represent those items as a QAbstractListModel and use it as
the source model for the MapItemView in QML.
> QDeclarativePolylineMapItem jas Path property that is type of QJSvalue and
> that looks only possible hook to c++, create path of polyline in C++ as
> QJSvalua and then pass this to Qml ?
There is also the addCoordinate()/removeCoordinate() invokable functions which
are easier to use than constructing a QJSValue, but probably less efficient if
adding or removing a large number of coordinates.
What sort of objects are you displaying on the map, is it just polylines?
> What is happening to Qt Maps C++ API ? There is still a lot of us that
> generate data displayed on map in C++ code and use Qml only for UI
There is currently a lack of developer resources working on the location
module. The good news is that recently the number of contributions to the
location module has increased.
Cheers,
--
Aaron McCarthy
More information about the Development
mailing list