summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativepolygonmapitem_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Reorganize code for map items into separate folderVolker Hilsheimer2022-09-231-140/+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>
* 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>
* Cleanup: remove virtual keyword from overridesVolker Hilsheimer2022-09-121-3/+3
| | | | | Change-Id: Iac3ac030809f57cfcffbfcc3257551efb6c1ff0f Reviewed-by: Ivan Solovev <ivan.solovev@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>
* 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>
* Enable mercator-to-screen projection in GLSLPaolo Angelelli2020-02-111-57/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-12-101-1/+0
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ifd3514a958d0df4320b253c26e3da3a632088be8
| * Fix missing geometry update when changing border widthPaolo Angelelli2018-11-191-1/+0
| | | | | | | | | | | | | | | | | | In this case, only border geometry was marked dirty, producing a misplaced polygon. Fixes: QTBUG-70886 Change-Id: Ied39e523a584976871a655e436daf8c2700458b6 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Make QDeclarativeGeoMapItemBase::geoShape R/WPaolo Angelelli2018-08-141-1/+3
|/ | | | | | | | 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-6/+2
| | | | | | | | | | | | | | | | | 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>
* Fix MapPolygon being drawn misplaced and moving as it gets clippedPaolo Angelelli2018-04-181-1/+1
| | | | | | | | This patch fixes a regression introduced with commit f0bc0db15ed262a8f31bb07b3b46a5cdf9277e79 Change-Id: Ie974b7a95d8ecd5f6affafc070848d289f7afa06 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Introduce map objects reference implementationPaolo Angelelli2018-04-171-2/+2
| | | | | | | | | | | | | | | | 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>
* 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-1/+4
| | | | | | | | | | | | 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/+161
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>