qtlocation

QML map zoom only verticaly

与世无争的帅哥 提交于 2021-01-28 11:20:47
问题 Does map in Qt have a property, so it doesn't move center if I move mouse cursor on random place on map and try to change zoom level with mouse wheel? Because on default, map zooms, but moves existing center towards mouse cursor location (example on picture below; if cursor is on shown position and we try to change zoom, geotag picture will move in arrow direction). I just need it to zoom straight up from designated center of map, regardless of mouse cursor location. Map description: https:/

QML MapPolygon from C++ model

我的未来我决定 提交于 2020-02-24 06:37:28
问题 I want to dynamically add/remove/edit MapPolygon in QML Map application. I have some others jobs with created polygons (file export/import etc.) so I think that I should use MapItemView with C++ model sotirng Polygons data. I tried to create my own model with my own QObject based objects: Object: class MODELSHARED_EXPORT Polygon : public QObject { Q_OBJECT Q_PROPERTY(QList<QGeoCoordinate> coordinates READ coordinates WRITE setCoordinates NOTIFY coordinatesChanged) public: explicit Polygon

QML MapPolygon from C++ model

醉酒当歌 提交于 2020-02-24 06:37:08
问题 I want to dynamically add/remove/edit MapPolygon in QML Map application. I have some others jobs with created polygons (file export/import etc.) so I think that I should use MapItemView with C++ model sotirng Polygons data. I tried to create my own model with my own QObject based objects: Object: class MODELSHARED_EXPORT Polygon : public QObject { Q_OBJECT Q_PROPERTY(QList<QGeoCoordinate> coordinates READ coordinates WRITE setCoordinates NOTIFY coordinatesChanged) public: explicit Polygon

Getting positions from gpsd in a Qt quick program

我怕爱的太早我们不能终老 提交于 2020-01-05 04:08:07
问题 I have a computer with a GPS connected to a serial port that is running gpsd with a pretty basic configuration. Here is the contents of /etc/default/gpsd: START_DAEMON="true" USBAUTO="false" DEVICES="/dev/ttyS0" GPSD_OPTIONS="-n -G" GPSD_SOCKET="/var/run/gpsd.sock" With this config, gpsd runs fine and all gpsd client utilities, e.g. cgps, gpspipe, gpsmon, can get data from the GPS. I am trying to access GPS data from a Qt QML program using the PositionSource element with the following syntax

Qt/Qml: Repeater vs. MapItemView for map elements

北城余情 提交于 2019-12-25 10:29:09
问题 I want to populate a Qml Map with map elements (like MapCircle, ...) from a QAbstractListModel . There seem to be two Qml tools suitable for this, MapItemView [1] and Repeater [2]. The Repeater is more powerful (e.g. it allows nested models) - so is there any reason to use the MapItemView instead of a Repeater ? Regards, [1] http://doc.qt.io/qt-5/qml-qtlocation-mapitemview.html [2] http://doc.qt.io/qt-5/qml-qtquick-repeater.html MapItemView source: http://code.qt.io/cgit/qt/qtlocation.git

AbstractItemModel to QML Route

给你一囗甜甜゛ 提交于 2019-12-04 04:57:23
问题 I have a set of QPointF in MarkerModel which subclasses from AbstractListModel . Each such marker have a status, depending on which they are colored. I want to draw all these markers on the map along with a polyline that connects all the points that have a specific status. And I will update the model from C++ side. This is my QML Map { id: map anchors.fill: parent plugin: mapPlugin center: QtPositioning.coordinate(22.5726, 88.3639) zoomLevel: 14 MapItemView { model: markerModel // delegate:

AbstractItemModel to QML Route

大憨熊 提交于 2019-12-02 02:36:30
I have a set of QPointF in MarkerModel which subclasses from AbstractListModel . Each such marker have a status, depending on which they are colored. I want to draw all these markers on the map along with a polyline that connects all the points that have a specific status. And I will update the model from C++ side. This is my QML Map { id: map anchors.fill: parent plugin: mapPlugin center: QtPositioning.coordinate(22.5726, 88.3639) zoomLevel: 14 MapItemView { model: markerModel // delegate: markerDelegate // markerDelegate works delegate: routeDelegate // routeDelegate does not work }