summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativegeomapitembase_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Reorganize code for map items into separate folderVolker Hilsheimer2022-09-231-174/+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-1/+1
| | | | | Change-Id: I6316384be07f1d0634860c3ddcbe85455e218fed Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Refactor: for loopsVolker Hilsheimer2022-09-141-6/+5
| | | | | | | | | | Replace indexed for loops with ranged for, replace int with qsizetype otherwise as appropriate. Apply const and line breaks in surrounding code. Pick-to: 6.2 Change-Id: I1c2ee372545b8ab2cbb84c4b4b97ae52dedff1d0 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Constructor cleanupVolker Hilsheimer2022-09-121-15/+10
| | | | | | | | 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>
* 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>
* Add missing overrideAlexander Volkov2020-06-291-2/+2
| | | | | Change-Id: Ieae01bc4669cdd503f97399c622989795a0ad734 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add geometry simplification to MapPolyline/MapPolylineObjectQSGPaolo Angelelli2020-02-121-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces a metric-based implementation of the Ramer-Douglas-Peucker line simplification algorithm to generate a LOD pyramid for the polyline geometries. This comes with a related property (in MapItemBase), lodThreshold, that can be used to change the threshold after which no simplification will be used. By default the value of this property is 0, meaning that the behavior will be unchanged and no LOD will be used. This change also introduces LOD on map polyine objects QSG, for which no property is introduced, and there's a default threshold set to zoom level 12 (which appear to produce acceptable results). Finally, this patch makes use of a threadpool with 1 thread to enqueue geometry simplification tasks, which would otherwise freeze the UI when computing for the first time. Support for geometry simplification is currently added only to polylines. It might be of interest extending it to polygons as well, once a proper strategy for handling the simplification of inner holes has been identified. Finally, extending it to circles could be of interest, while potentially bringing only minor benefits, as circle geometries are currently fixed to 128 vertices. Also adds a MapObject-based delegate to the geojson viewer example. Task-number: QTBUG-46652 Task-number: QTBUG-38459 Task-number: QTBUG-49303 Change-Id: I64b5db4577962db17e5388812909285c9356ef0d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Enable mercator-to-screen projection in GLSLPaolo Angelelli2020-02-111-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add autoFadeIn property to map itemsPaolo Angelelli2019-08-211-0/+5
| | | | | | | | | | | | | | This property allows a user to disable the until now built-in behavior that makes map items fade in or fade out between zoom levels 1.5 and 2.5. By default the old behavior is kept. [ChangeLog][Location][MapItems] Added property to disable the automatic fade-in/fade-out behavior on low zoom levels Change-Id: Id764f12d34db528f533f14fd561604507681f216 Fixes: QTBUG-76867 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix crash when removing items from MapboxGL mapsPaolo Angelelli2019-01-291-1/+3
| | | | | | | | 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 QDeclarativeGeoMapItemBase::geoShape R/WPaolo Angelelli2018-08-141-1/+2
| | | | | | | | This patch adds a setter for the geoShape property, overridden in the subclasses. Change-Id: I5fc4d412efee5e95c5650943ea5bf9b72dc40155 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Enable nested MapItemViewsPaolo Angelelli2018-07-271-32/+5
| | | | | | | | | | | | | | | | | | | | | | | | | This change allows MapItemView to use a MapItem, MapItemGroup or MapItemView as delegate. To achieve this, MapItemView base class also changes from QObject to MapItemGroup, effectively making MapItemView a MapItemGroup. Note, though, that MapItemGroup API in Map should be avoided, when dealing with a MapItemView, and only MapItemView-specific API should be used. Tests and example coming after [ChangeLog][QtLocation] Enabled nesting of MapItemView. This required a behavioral change, as MapItemView is now a MapItemGroup, not anymore a plain QObject. Due to a bug, MapItemView was previously not a Qt Quick Item, making it possible to create it as a child of any QObject. This has now been fixed, so if you happen to have a MapItemView in your scene which is not a child of a Qt Quick Item, you will get an error message. Task-number: QTBUG-62683 Task-number: QTBUG-62397 Change-Id: Id97e480429e7f952a541fe88df5c01317afeac18 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Introduce Map.visibleAreaPaolo Angelelli2018-07-261-0/+1
| | | | | | | | | | This will allow moving the visible map area to a subregion of the viewport, allowing to maintain the desired visible region visible when overlaying controls on top of the map. Task-number: QTBUG-68966 Change-Id: Idf4b30f7c1e4062e5e1c0ddc01a31bc856c0bc0c Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add QML revision info to new QML signals in geomapitembaseAlex Blasche2018-04-191-2/+2
| | | | | Change-Id: I5c3e45a5d44f3f7f5c3ecda6823035aae07ae825 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Merge remote-tracking branch 'origin/wip/navigation' into 5.11Paolo Angelelli2018-04-171-1/+1
|\ | | | | | | | | | | | | | | | | Conflicts: src/location/declarativemaps/qgeomapobject.cpp src/location/declarativemaps/qgeomapobject_p_p.h src/plugins/geoservices/itemsoverlay/qgeomapitemsoverlay.h Change-Id: Iab847e16011b2095d307e2a3610bf9157ae7b92d
| * Change QDeclarativeGeoMapItemBase::map_ into a QPointerPaolo Angelelli2018-02-211-1/+1
| | | | | | | | | | | | | | | | Or else it may cause crashes on shutdown due to map_ not being parented with QDeclarativeGeoMap and potentially being deleted earlier. Change-Id: I2bed1c884eb556e48261371e889aae5e190476bc Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Fix MapItemView not setting context data upon item deletionPaolo Angelelli2018-04-171-1/+38
|/ | | | | | | | | | | | | | | | | | | | The current implementation does not properly re-set context data upon model item deletion/change. This patch uses a QQmlDelegateModel that does all the management internally. To accommodate for items disappearing/reappearing all at once, potentially introducing flickering, a fixed opacity transition 300msec long has been introduced as exit transition. In later Qt releases, new API can be added to let the user change it, as well as also adding an enter transition and possibly more. Task-number: QTBUG-62086 Task-number: QTBUG-65833 Change-Id: I59a8147a12f035d5c7f86c2546e9144b2e1a7b3c Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Remove dirty geo* flags from map itemsv5.9.0-alpha1Paolo Angelelli2017-02-131-19/+0
| | | | | | | | | | | The recommended way for a plugin to get notification for when to update items is to connect to the item's signals. Therefore these introduced dirty flags that would have to be checked in a loop can be removed. Change-Id: I28c9b236b3a2e6296a89649b604381a2001a0b20 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add mapItemOpacity signal to QDeclarativeGeoMapItemBasePaolo Angelelli2017-01-311-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | Map items are different from regular QQuickItems in that they could be rendered externally of the qtquick scene graph renderer. With the introduction of MapItemGroups, the opacity of map items can be changed not only by setting the opacity property of an item, but also by changing the opacity property of a MapItemGroup, which would affect the opacity of all the items contained inside. When these items are handed over to a plugin for rendering, it becomes therefore impossible to know when the opacity of the group changes. The new signal mapItemOpacity serves the purpose of communicating whether either the opacity property of an item, or the opacity property of its MapItemGroup parent (if the item happens to be inside a group) changes. The associated mapItemOpacity is then in charge of returning the correct combined opacity of the item. Change-Id: I0ecbd1fc4c220291209e649bb44848854760f682 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Allow QGeoMap to render map itemsPaolo Angelelli2017-01-301-0/+23
| | | | | | | | | | | | | | | | | 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/+123
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>