summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>2020-01-22 14:00:37 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2020-01-27 12:41:47 +0100
commit2aac6b3f26690b4d1be94be8f2b556794b022301 (patch)
treef397c85d22342ec87f2e64b3707c39f19fbc0256
parent6423670fd00fb2b0918c41d9cbf8783912356619 (diff)
downloadqtlocation-2aac6b3f26690b4d1be94be8f2b556794b022301.tar.gz
Fix build with latest qtbase and qtdeclarative
* Bump the submodule to include the one build fix for sqlite3. * Rename VisualDataModel to DelegateModel (it's been the latter for many years and now the old name vanished) * Fix dangling pointers into QList. In clearMapItems() we iterate over m_mapItems and call removeMapItems(), which also removes from the same QList (now vector). The same goes for m_mapItemGroups. Change-Id: I4c229fd2cf1bce76d6ad5ffae4bdbda7fe8e6a18 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
m---------src/3rdparty/mapbox-gl-native0
-rw-r--r--src/location/declarativemaps/qdeclarativegeomap.cpp18
-rw-r--r--tests/auto/declarative_core/tst_category.qml3
-rw-r--r--tests/auto/declarative_core/tst_categorymodel.qml12
-rw-r--r--tests/auto/declarative_core/utils.js12
5 files changed, 25 insertions, 20 deletions
diff --git a/src/3rdparty/mapbox-gl-native b/src/3rdparty/mapbox-gl-native
-Subproject d9577fdebe019b19e184b4cac82749ae9ec87af
+Subproject 8af62305d2e0208357c98e61bc2a9c9de8fe611
diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp
index 6a2d82e8..167f1d5f 100644
--- a/src/location/declarativemaps/qdeclarativegeomap.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomap.cpp
@@ -2058,20 +2058,24 @@ void QDeclarativeGeoMap::clearMapItems()
return;
int removed = 0;
- for (auto i : qAsConst(m_mapItemGroups)) {
+ for (int i = 0; i < m_mapItemGroups.count(); ++i) {
+ auto item = m_mapItemGroups.at(i);
// Processing only top-level groups (!views)
- QDeclarativeGeoMapItemView *view = qobject_cast<QDeclarativeGeoMapItemView *>(i);
- if (view)
+ if (qobject_cast<QDeclarativeGeoMapItemView *>(item))
continue;
- if (i->parentItem() != this)
+
+ if (item->parentItem() != this)
continue;
- removed += removeMapItemGroup_real(i);
+ if (removeMapItemGroup_real(item)) {
+ removed++;
+ --i;
+ }
}
- for (auto i : qAsConst(m_mapItems))
- removed += removeMapItem_real(i);
+ while (!m_mapItems.isEmpty())
+ removed += removeMapItem_real(m_mapItems.first());
if (removed)
emit mapItemsChanged();
diff --git a/tests/auto/declarative_core/tst_category.qml b/tests/auto/declarative_core/tst_category.qml
index 51809dc3..f0a14d6f 100644
--- a/tests/auto/declarative_core/tst_category.qml
+++ b/tests/auto/declarative_core/tst_category.qml
@@ -27,6 +27,7 @@
****************************************************************************/
import QtQuick 2.0
+import QtQml.Models 2.14
import QtTest 1.0
import QtLocation 5.3
import "utils.js" as Utils
@@ -100,7 +101,7 @@ TestCase {
visibility: Place.DeviceVisibility
}
- VisualDataModel {
+ DelegateModel {
id: categoryModel
model: CategoryModel {
diff --git a/tests/auto/declarative_core/tst_categorymodel.qml b/tests/auto/declarative_core/tst_categorymodel.qml
index 86d0fd4c..59ec3e7c 100644
--- a/tests/auto/declarative_core/tst_categorymodel.qml
+++ b/tests/auto/declarative_core/tst_categorymodel.qml
@@ -74,9 +74,9 @@ TestCase {
function test_hierarchicalModel() {
var modelSpy = Qt.createQmlObject('import QtTest 1.0; SignalSpy {}', testCase, "SignalSpy");
- var categoryModel = Qt.createQmlObject('import QtQuick 2.0; import QtLocation 5.3;'
- + 'VisualDataModel { model: CategoryModel {} delegate: Item {} }',
- testCase, "VisualDataModel");
+ var categoryModel = Qt.createQmlObject('import QtQuick 2.0; import QtQml.Models 2.14; import QtLocation 5.3;'
+ + 'DelegateModel { model: CategoryModel {} delegate: Item {} }',
+ testCase, "DelegateModel");
modelSpy.target = categoryModel.model;
modelSpy.signalName = "statusChanged";
@@ -147,9 +147,9 @@ TestCase {
function test_flatModel() {
var modelSpy = Qt.createQmlObject('import QtTest 1.0; SignalSpy {}', testCase, "SignalSpy");
- var categoryModel = Qt.createQmlObject('import QtQuick 2.0; import QtLocation 5.3;'
- + 'VisualDataModel { model: CategoryModel {} delegate: Item {} }',
- testCase, "VisualDataModel");
+ var categoryModel = Qt.createQmlObject('import QtQuick 2.0; import QtQml.Models 2.14; import QtLocation 5.3;'
+ + 'DelegateModel { model: CategoryModel {} delegate: Item {} }',
+ testCase, "DelegateModel");
modelSpy.target = categoryModel.model;
modelSpy.signalName = "statusChanged";
diff --git a/tests/auto/declarative_core/utils.js b/tests/auto/declarative_core/utils.js
index 5370bab5..2b7dca32 100644
--- a/tests/auto/declarative_core/utils.js
+++ b/tests/auto/declarative_core/utils.js
@@ -97,8 +97,8 @@ function testConsecutiveFetch(testCase, model, place, expectedValues, data)
signalSpy.target = model;
signalSpy.signalName ="totalCountChanged";
- var visDataModel = Qt.createQmlObject('import QtQuick 2.0; '
- + 'VisualDataModel{ delegate: Text{} }',
+ var visDataModel = Qt.createQmlObject('import QtQuick 2.0; import QtQml.Models 2.14; '
+ + 'DelegateModel{ delegate: Text{} }',
testCase, "dataModel");
visDataModel.model = model;
@@ -140,8 +140,8 @@ function testConsecutiveFetch(testCase, model, place, expectedValues, data)
function testReset(testCase, model, place)
{
- var dataModel = Qt.createQmlObject('import QtQuick 2.0; '
- + 'VisualDataModel{ delegate: Text{} }',
+ var dataModel = Qt.createQmlObject('import QtQuick 2.0; import QtQml.Models 2.14; '
+ + 'DelegateModel{ delegate: Text{} }',
testCase, "dataModel");
dataModel.model = model;
@@ -160,8 +160,8 @@ function testReset(testCase, model, place)
function testFetch(testCase, data)
{
var model = data.model;
- var visDataModel = Qt.createQmlObject('import QtQuick 2.0; '
- + 'VisualDataModel{ delegate: Text{} }',
+ var visDataModel = Qt.createQmlObject('import QtQuick 2.0; import QtQml.Models 2.14; '
+ + 'DelegateModel{ delegate: Text{} }',
testCase, "dataModel");
visDataModel.model = model