summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativepolylinemapitem_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Reorganize code for map items into separate folderVolker Hilsheimer2022-09-231-177/+0
| | | | | | | | | Splitting the code that only provides declarative wrappers around types from the implementations of the map and item rendering makes it easier to work with the code base and identify dependencies. Change-Id: I00064f928043dfa77f22e68b1efe54f414cb62f7 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Cleanup: More nullptr instead of 0Volker Hilsheimer2022-09-191-2/+2
| | | | | Change-Id: I6316384be07f1d0634860c3ddcbe85455e218fed Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Change QJSValue properties to QList<QGeoCoordinate/Rectangle>Volker Hilsheimer2022-09-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QML engine is able to operate on lists of gadgets, there is no need for using private APIs to operate on QJSValue. For the time being, this breaks a QML construct like path[0].longitude = 0 This no longer changes the value of path[0].latitude in place. Instead, use var path0 = path[0] path0.longitude = ... path[0] = path0 This is consistent with other properties that have type list<gadget>, as QML operates on copies of values, not on references. Adapt the test case accordingly. Since support for value-initializing properties of type list<gadget> requires plumbing in the QML engine, and registration of conversion routines from QVariantMap to QGeoCoordinate, augment the test. Remove the now unnecessary toList/fromList conversion functions, and the dependency to private QtQml libraries. Fixes: QTBUG-105241 Change-Id: I8f248c457a6de27a3b2680bdc948c5683ebc7fa0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Constructor cleanupVolker Hilsheimer2022-09-121-5/+5
| | | | | | | | Use member initialization, and remove unneeded implementations of special member functions. Fix coding style in related code. Change-Id: I3326e3f331762a9c1ad3c3baac0de02fc5bb2b44 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Cleanup: remove virtual keyword from overridesVolker Hilsheimer2022-09-121-3/+3
| | | | | Change-Id: Iac3ac030809f57cfcffbfcc3257551efb6c1ff0f Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* More include cleanupVolker Hilsheimer2022-07-291-3/+4
| | | | | | | | | | | Remove includes of private headers from other modules where possible. Get rid of some duplicate includes, and try to group includes by module, with private includes in a separate block for better visibility where we have dependencies to private APIs. Pick-to: 6.2 Change-Id: Ia6419bee2a2c50463dcc515f3f1590a749dfabc1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Silence build warnings, fix build errorsVolker Hilsheimer2022-06-161-1/+1
| | | | | | | | | | Replace various deprecated APIs with their supported Qt 6 versions. Most notably, replace QScopedPointer with std::unique_ptr, as the code frequently use deprecated QScopedPointer::swap. Change-Id: If9cb0be89423fd310073709eb390401d74240153 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Port OpenGL dependent code to Qt6 updated graphics APILauri Laanmets2022-02-281-2/+0
| | | | | | | | | | | | All 'old' map object ported to new Qt6 API and tested (almost). Labs project is not tested. This is part of a bigger work to port QtLocation maps to Qt6. Task-number: QTBUG-96795 Change-Id: I0b748a7f4c37f4fcc0cad038e2846b7c86dec84e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Use up-to date LGPL license headerKai Köhne2021-12-021-11/+14
| | | | | | | | Remove usages of outdated LGPL3 header that references LICENSES.LGPLv3 instead of LICENSES.LGPL3. Change-Id: Ied647fc10d2bf051cccc8b38d75570b7caef1f28 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Change 'geometryChanged' to 'geometryChange'Lauri Laanmets2021-11-091-1/+1
| | | | | | | | | | | | | As stated by the documentation: https://doc.qt.io/qt-6/quick-changes-qt6.html#changes-to-qquickitem This is part of a bigger work to port QtLocation maps to Qt6. Task-number: QTBUG-96795 Change-Id: I9dcf2e454d949dfbf3a9861b98eb949be6e6df56 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* Fix compilation for no opengl buildsMichal Klocek2021-03-251-0/+2
| | | | | | | | | | | | | Disables experimental labs qml plugin, which since a4469cad40 depends heavily on opengl backend. Fix warnings with msvc when compiling without experimental plugin. Task-number: QTBUG-91623 Fixes: QTBUG-88017 Change-Id: I53c5da915981bd05f39134ba57f585d0a0786aa8 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Enable mercator-to-screen projection in GLSLPaolo Angelelli2020-02-111-90/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change, all the geo-to-screen conversion, and the triangulation operations for geo polylines and geo polygon are performed either at set time or in the shader. A separate bounding box geometry is processed in the old way to provide a correct QtQuick Item geometry, that can be used for nesting mouse areas, performing translations, input event delivery, etc. With this approach, performance are improved by more than one order of magnitude in average, but complex geometries will of course benefit more. It also adds correct rendering support for polygons with holes, previously only rendered correctly by the MapboxGL plugin. The polyline shader has basic miter joins. The miter is skipped if the angle is too sharp to avoid complicating the implementation. This shader introduces some glitches when the polyline is minified, for which the real fix is to have LOD for the geometry, and render simplified geometries at low zoom levels (added in a subsequent patch). Note: this approach, at least in its current implementation, does not support enabling layers on individual items, only on the Map element. Task-number: QTBUG-49303 Task-number: QTBUG-38459 Change-Id: I0c2dc0bf364d32f74ca7c4014f6d66e6219c8ae4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix crash when removing items from MapboxGL mapsPaolo Angelelli2019-01-291-1/+0
| | | | | | | | Triggered by usage of a virtual method in superclass destructor. Change-Id: If99e523e42fd13686ae43c0083a74e1b68221fc7 Fixes: QTBUG-67638 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Make tiled renderer and QGeoProjectionWebMercator debuggablePaolo Angelelli2018-11-281-1/+10
| | | | | | | | | | | | | | | This patch introduces a new macro, QT_LOCATION_DEBUG, that, when fed via qmake command line, changes the scope of some members, adds some extra members and some extra data dumping into these members. In this way external code can inspect the state of the renderer in order to debug it. The patch also moves a few classes into separate files, as well as privately exporting them. Change-Id: I32a042863f78dcd10f94b0b7fe8b90f3fc486891 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Make QDeclarativeGeoMapItemBase::geoShape R/WPaolo Angelelli2018-08-141-0/+1
| | | | | | | | This patch adds a setter for the geoShape property, overridden in the subclasses. Change-Id: I5fc4d412efee5e95c5650943ea5bf9b72dc40155 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix QGeoMapObject handling in reference implementationPaolo Angelelli2018-04-221-4/+23
| | | | | | | | | | | | | | | | | setVisible was neither changing the visibility nor triggering repaint. Pimpls weren't removing themselves in their destructors when dynamically added/removed via QGeoMapObjectView add/removeMapObject. This patch also factors out the duplicated QGeoMapObject support from QGeoTiledMapLabs and QGeoMapObjectsOverlay and moves it into an own class, QGeoMapObjectQSGSupport. To properly flush the scene graph nodes upon object removal, a pointer to the QSGNode is added to the MapObject struct, now moved inside QGeoMapObjectQSGSupport. Change-Id: Ie8c6d54f8f340ba3867717d9620791d3fe8021cc Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Add QGeoMapPolylineGeometry::containsPaolo Angelelli2018-04-191-0/+2
| | | | | | | | | | | | This patch makes QGeoMapItemGeometry::contains virtual, and overrides it in QGeoMapPolylineGeometry, so that it can be used in items that have QGeoMapPolylineGeometry for borders. This patch fixes the issue of map polygons not being interactive on their borders. Task-number: QTBUG-67765 Change-Id: I7c571e57b9f1d26203f3e5857d47e85380281b28 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix MapPolyline being drawn misplaced and moving when clippedPaolo Angelelli2018-04-191-1/+2
| | | | | | | Regression introduced in f0bc0db15ed262a8f31bb07b3b46a5cdf9277e79 Change-Id: I4c4a3cb2302daeb825be21f9e2f6c235d2cb7c93 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Introduce map objects reference implementationPaolo Angelelli2018-04-171-3/+4
| | | | | | | | | | | | | | | | This patch introduces a reference implementation for the QGeoMapObject subclasses in the locationlabs module. If this module is built, all current plugins, with the exception of mapboxgl, will also be able to render map objects. The current reference implementation of map objects is not optimized, but it can be useful for both testing and feature parity (so that switching between plugins will give the same result). Change-Id: I830ebb3813f219e42c085f450952a2b4327361cd Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add override to MapPolygonNode/MapPolylineNode::isSubtreeBlockedPaolo Angelelli2018-02-141-1/+1
| | | | | Change-Id: I30ffbe559af8cf911a3525b578a875b5dab69c51 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Replace Q_DECL_OVERRIDE with overrideKevin Funk2018-02-051-8/+8
| | | | | Change-Id: Iaa670de181255ea570fcf7bcbe465987ef7fc2fc Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add setPath overload to QDeclarativePolylineMapItemPaolo Angelelli2017-08-031-0/+1
| | | | | | | | | | | | | | | This patch adds a Q_INVOKABLE setPath overload that takes a QGeoPath. This can be beneficial when a path is already available and should be set without going through javascript array conversion. This method should come handy also when pushing polyline data from C++. [ChangeLog][QtLocation][MapPolyline] Added setPath overload taking a QGeoPath. Change-Id: I6916500473865b8234b48e8df08dfb465a2a75d2 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Remove pathPropertyChanged() from Polyline,PolygonPaolo Angelelli2017-03-221-1/+0
| | | | | | | This private method is not even implemented. Change-Id: I30c0e559d0264f1b0eb6d394c9675879b23be44e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Cache coordinate projections in map itemsPaolo Angelelli2017-03-221-2/+5
| | | | | | | | | | | | This patch caches the result of geoToMapProjection() for the coordinates of the map items, regenerating this data only upon coordinate changes. This allows avoiding to perform a (mercator) projection basically every time the item has to be drawn, and instead do only the wrapping around the camera center and the projection to screen Task-number: QTBUG-59479 Change-Id: Iea5ec04f360d2fe7495cd9c1dd278e83200e0f8d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Allow QGeoMap to render map itemsPaolo Angelelli2017-01-301-0/+1
| | | | | | | | | | | | | | | | | Currently QtLocation Map items are always rendered by QtLocation, on top of what QGeoMap generates. This patch introduces a new private api call to QGeoMap, supportedMapItemTypes(), that is used to inform QtLocation to not render map items of those types, but rather pass them over to the QGeoMap, which will take care of the rendering. In this way, more advanced renderers can properly render map items, for example below labels or 3D buildings. Change-Id: I1c82d4f11d4dd44c3011926512520d62e26295d4 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Moving location qml implementation to location/declarative*Paolo Angelelli2017-01-261-0/+197
QtLocation quick classes and headers are moved out of the import directory. The location quick classes are now in a subdirectory inside the main qtlocation module. This is necessary in order to privately export certain classes, such as Map Items classes, and create an API to inject these objects into QGeoMap to let plugins render the Map Items directly Change-Id: Ia6ba5f07c4eddd3c4c2ce54bf34f1afcd42c2558 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>