diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-07-21 18:55:37 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-04-17 13:36:34 +0000 |
commit | 572957bb1326190672ea138ccf475c0cf1893192 (patch) | |
tree | 7679c6062673a25af15a7b2cead6325316e87676 /tests/auto | |
parent | 9277ad55ad1a76492a3985460569d0a6fd15b08a (diff) | |
download | qtlocation-572957bb1326190672ea138ccf475c0cf1893192.tar.gz |
Fix MapItemView not setting context data upon item deletion
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>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/declarative_ui/tst_map_itemview.qml | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/auto/declarative_ui/tst_map_itemview.qml b/tests/auto/declarative_ui/tst_map_itemview.qml index ff24e7af..097212ca 100644 --- a/tests/auto/declarative_ui/tst_map_itemview.qml +++ b/tests/auto/declarative_ui/tst_map_itemview.qml @@ -447,7 +447,8 @@ Item { } testingListModel.remove(0) - compare(mapForTestingListModel.mapItems.length, 2) + // default exit animation kicks in here, of length 300msec + tryCompare(mapForTestingListModel, "mapItemsLength", 2) for (var i = 0; i < 2; ++i) { itemCoord = mapForTestingListModel.mapItems[i].center @@ -460,7 +461,8 @@ Item { compare(mapForTestingListModel.mapItems[2].center, QtPositioning.coordinate(1, 1)) testingListModel.clear() - compare(mapForTestingListModel.mapItems.length, 0) + // default exit animation kicks in here, of length 300msec + tryCompare(mapForTestingListModel, "mapItemsLength", 0) // Repopulating the model with initial data testingListModel.append({ "lat": 11, "lon": 31 }) @@ -511,7 +513,8 @@ Item { routeModel.update(); tryCompare(mapForTestingRouteModel, "mapItemsLength", 3) routeModel.reset(); - compare(mapForTestingRouteModel.mapItems.length, 0) + // default exit animation kicks in here, of length 300msec + tryCompare(mapForTestingRouteModel, "mapItemsLength", 0) routeModel.reset(); // clear empty model routeQuery.numberAlternativeRoutes = 3 routeModel.update(); @@ -532,7 +535,8 @@ Item { compare(mapForTestingRouteModel.mapItems.length, 4) compare(mapForTestingRouteModel.mapItems[3], externalCircle2) routeModel.reset(); - compare(mapForTestingRouteModel.mapItems.length, 1) + // default exit animation kicks in here, of length 300msec + tryCompare(mapForTestingRouteModel, "mapItemsLength", 1) mapForTestingRouteModel.clearMapItems() compare(mapForTestingRouteModel.mapItems.length, 0) |