Re: [Development] Qt5.3 / Location Maps
I have done more work towards our app QtQuick2 transition. Several things I found out - Qt3d and location with geoservices compiles nicely for Android and iOS - For iOS by default they still create dynamic libs and needs to be patched to make static version - After iOS make is made, make clean distclean does not clean all but if I would like to compile an other platform, I need to take clean snapshot - For Android, getting geoservices map plugin found during runtime requires a lot of tweaking, it does not work out of the box even it builds without problems - For Ubuntu and OSX all works out of the box Then back to the previous question, how input data from C++ app to Map. On Thu, May 8, 2014 at 1:40 PM, Kate Alhola kate.alh...@gmail.com wrote: On Wed, May 7, 2014 at 3:41 AM, Aaron McCarthy mccarthy.aa...@gmail.com wrote: 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. That's clear and reasonable way of working. Mostly I was missing some way to use data produced from C++ in Qml maps event with standard already defined C++ types like QGeoCoordinate or QListQGeoCoordinate Something like in C++ ( qith all QProperty stuff ) QListQGeoCoordinate path; And in Qml MapPolyline { line.color: blue coordinates:path } Or similar way to have Markers. 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. It looks that with this Abstract does same thing, I just need to convert old code from QGeoMapObjects/QListQGeoCoordinate to QAbstractListModel . Let's see how it works Least i did not find right way to do this so that it works. 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. I hope that this QAbstractListModel does the thing I Tried also QJSValue but no success by using standard QJSVallue. I was able to construct array of strut QJSValue but I never succeeded to return it. I searched all documentation and QTSOurce code unsucessfully. When I look Qt Code they always used different way, so may be there is no way to return QJSValue array using public class ? return new QJSValuePrivate(v4, QV4::ValueRef(pathArray)); Finally only way how I did it working was to do same way it was done in QJSValue QDeclarativePolygonMapItem::path() const There was just one very ugly thing, it depends a bunch of private headers. So, only working way to export map path from C++ core to Qml Map is one that has a lot of dependency to private headers. I hope still for future: - Please have function to accept QListQGeoCoordinate path. There is no value added to convert it to QJSValue and then inside of iten back to QListQGeoCoordinate -May bey there should be ways to construct QJSValues without using a lot of private headers. Kate What sort of objects are you displaying on the map, is it just polylines? The application I have is sports app that stores route of training events that are in current version displayed as QGeoMapPolylineObject . The data is generated by our app and stored in database. Application runs on Android/iOS and desktop. Because for usability reasons fast response is important, I wont add extra JS layers just copy coordinates etc fro C++ to Map. We started with Qt4.8 / Necessitas but now we have switched to Qt5.3 /QtQuick1 and next step is to go QtQuick2. What is happening to Qt Maps
Re: [Development] Qt5.3 / Location Maps
Hi, Not sure what kind of custom mods you have but a module claims plugin ownership via MODULE_PLUGIN_TYPES = geoservices (see qtloation.pro) The plugin declares its type via PLUGIN_TYPE = geoservices (e.g. see src/plugins/geoservices/osm/osm.pro And the system enforces this in mkspecs/features/create_cmake.pf My guess is that your code doesn't do one of the above two steps. -- Alex -Original Message- From: development-bounces+alexander.blasche=digia@qt-project.org [mailto:development-bounces+alexander.blasche=digia@qt-project.org] On Behalf Of Kate Alhola Sent: Sunday, 11 May 2014 12:54 To: Aaron McCarthy Cc: development@qt-project.org Subject: Re: [Development] Qt5.3 / Location Maps I just updated to Qt5.3RC and noticed that something has changed in modules build system since beta. I was able to compile QtQuick1 maps I ported form 4.8 with Beta but mo more with 5.3RC or least not for ios. There is issue that I got error Project ERROR: No module claims plugin type 'geoservices' This error did not appear in 5.3beta Reason is that in 5.3RC it requires mkspecs/modules/qt_lib_location.pri with line QT.location.plugin_types = geoservices This file is created with new Qt5Location that requires qt3d and qt3d is not compiling as static lib required for ios I got QtQuick1 maps compiled for Linux/OSX/Android when I first compiled and installed qt3d and then rebuild location with new maps even the QtQuick1 maps does not require either of them. I have tried find out where this mkspecs//modules/qt_lib_location.pri ic created but I have not yet find out that. Least it was not required in Beta to compile Qtquick1 maps. Any hints to documents how to create mkspecs/modules/qt_lib_location.pri and any hint how to compile qt3d for ios Kate ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
Re: [Development] Qt5.3 / Location Maps
I just updated to Qt5.3RC and noticed that something has changed in modules build system since beta. I was able to compile QtQuick1 maps I ported form 4.8 with Beta but mo more with 5.3RC or least not for ios. There is issue that I got error Project ERROR: No module claims plugin type 'geoservices' This error did not appear in 5.3beta Reason is that in 5.3RC it requires mkspecs/modules/qt_lib_location.pri with line QT.location.plugin_types = geoservices This file is created with new Qt5Location that requires qt3d and qt3d is not compiling as static lib required for ios I got QtQuick1 maps compiled for Linux/OSX/Android when I first compiled and installed qt3d and then rebuild location with new maps even the QtQuick1 maps does not require either of them. I have tried find out where this mkspecs//modules/qt_lib_location.pri ic created but I have not yet find out that. Least it was not required in Beta to compile Qtquick1 maps. Any hints to documents how to create mkspecs/modules/qt_lib_location.pri and any hint how to compile qt3d for ios Kate ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
Re: [Development] Qt5.3 / Location Maps
On Wed, May 7, 2014 at 3:41 AM, Aaron McCarthy mccarthy.aa...@gmail.comwrote: 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. That's clear and reasonable way of working. Mostly I was missing some way to use data produced from C++ in Qml maps event with standard already defined C++ types like QGeoCoordinate or QListQGeoCoordinate Something like in C++ ( qith all QProperty stuff ) QListQGeoCoordinate path; And in Qml MapPolyline { line.color: blue coordinates:path } Or similar way to have Markers. 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. It looks that with this Abstract does same thing, I just need to convert old code from QGeoMapObjects/QListQGeoCoordinate to QAbstractListModel . Let's see how it works 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. I hope that this QAbstractListModel does the thing What sort of objects are you displaying on the map, is it just polylines? The application I have is sports app that stores route of training events that are in current version displayed as QGeoMapPolylineObject . The data is generated by our app and stored in database. Application runs on Android/iOS and desktop. Because for usability reasons fast response is important, I wont add extra JS layers just copy coordinates etc fro C++ to Map. We started with Qt4.8 / Necessitas but now we have switched to Qt5.3 /QtQuick1 and next step is to go QtQuick2. 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. That's great. If there is anything on our work that can help, i am happy to help. Kate Cheers, -- Aaron McCarthy ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
Re: [Development] Qt5.3 / Location Maps
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 ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development