diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-05-07 16:46:12 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-07-27 08:18:38 +0000 |
commit | fd6c6e9654a14788fc4eb7384c9dfa5de1f5ffde (patch) | |
tree | d15088fbdac71e31fc5ef8aa445df39b6fb4070d /tests | |
parent | 6815fd10c51c72ea91bdbc18acddaee2302871f8 (diff) | |
download | qtlocation-fd6c6e9654a14788fc4eb7384c9dfa5de1f5ffde.tar.gz |
Enable nested MapItemViews
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>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/declarative_ui/tst_map_itemview.qml | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/auto/declarative_ui/tst_map_itemview.qml b/tests/auto/declarative_ui/tst_map_itemview.qml index 097212ca..0ab9d494 100644 --- a/tests/auto/declarative_ui/tst_map_itemview.qml +++ b/tests/auto/declarative_ui/tst_map_itemview.qml @@ -28,7 +28,7 @@ import QtQuick 2.0 import QtTest 1.0 -import QtLocation 5.6 +import QtLocation 5.12 import QtPositioning 5.5 import QtLocation.Test 5.5 @@ -49,6 +49,7 @@ Item { MapItemView { id: routeItemViewExtra model: routeModel + incubateDelegates: false delegate: Component { MapRoute { route: routeData @@ -58,6 +59,10 @@ Item { MapItemView { id: listModelItemViewExtra + objectName: "listModelItemViewExtra" + incubateDelegates: false + add: null + remove: null model: ListModel { id: testingListModelExtra ListElement { lat: 11; lon: 31 } @@ -252,6 +257,9 @@ Item { MapItemView { id: listModelItemView + incubateDelegates: false + add: null + remove: null model: ListModel { id: testingListModel ListElement { lat: 11; lon: 31 } @@ -487,7 +495,7 @@ Item { testingListModelExtra.clear() tryCompare(mapForTestingListModel, "mapItemsLength", 0) mapForTestingListModel.removeMapItemView(listModelItemViewExtra) - + tryCompare(mapForTestingListModel, "mapItemsLength", 0) mapForTestingListModel.addMapItemView(listModelItemView) tryCompare(mapForTestingListModel, "mapItemsLength", 3) |