Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.7.2
-
-
1
-
8eb361265 (dev), f8ca000a7 (6.9), eb22f19aa (6.8)
-
Foundation Sprint 126
Description
What we did
We have a list model of map lines stored as QGeoPaths in C++ that are rendered on a QML Map. We are using MapItemView with MapPolyline as a delegate.
For optimized use of memory, our application does not remove rows from the list model when lines go out of view. Instead, it sets certain rows to empty QGeoPath()s when they go out of the current map viewing area.
What we expected to happen
Empty QGeoPath() is tolerated by MapPolyline with the default (Map) referenceSurface. We expect the same behavior if the referenceSurface property is set to Globe.
What happened instead
If we set it to QtLocation.ReferenceSurface.Globe, the application crashes within the QML layer. To work around this, we have to add an arbitrary point to the empty QGeoPath. But the behavior should be the same, regardless of the referenceSurface. It should still tolerate empty paths.
Steps to reproduce
Run the attached code as a project. Crash happens immediately.
Stack trace
1 QGeoCoordinate::QGeoCoordinate(QGeoCoordinate const&) 0x7ffff7b976e0 2 void QtPrivate::QMovableArrayOps<QGeoCoordinate>::emplace<QGeoCoordinate const&>(long long, QGeoCoordinate const&) 0x7ffff7ca97a1 3 QDeclarativeGeoMapItemUtils::greaterCirclePath(QList<QGeoCoordinate> const&, QDeclarativeGeoMapItemUtils::greaterCirclePathForm, int) 0x7ffff7d4c059 4 QDeclarativePolylineMapItemPrivateCPU::regenerateCache() 0x7ffff7d54379 5 QDeclarativePolylineMapItem::setPathFromGeoList(QList<QGeoCoordinate> const&) 0x7ffff7d54669 6 QQmlPropertyData::writeProperty(QObject *, void *, QFlags<QQmlPropertyData::WriteFlag>) const 0x7ffff6afabb4 7 QQmlPropertyPrivate::write(QObject *, QQmlPropertyData const&, QVariant const&, QQmlRefPointer<QQmlContextData> const&, QFlags<QQmlPropertyData::WriteFlag>) 0x7ffff6bb3615 8 QQmlBinding::slowWrite(QQmlPropertyData const&, QQmlPropertyData const&, QV4::Value const&, bool, QFlags<QQmlPropertyData::WriteFlag>) 0x7ffff6af5fb6 9 GenericBinding<0>::write(QV4::Value const&, bool, QFlags<QQmlPropertyData::WriteFlag>) 0x7ffff6af7fc5 10 QQmlBinding::doUpdate(QQmlJavaScriptExpression::DeleteWatcher const&, QFlags<QQmlPropertyData::WriteFlag>, QV4::Scope&) 0x7ffff6af39e1 11 QQmlBinding::update(QFlags<QQmlPropertyData::WriteFlag>) 0x7ffff6af7331 12 QQmlNotifier::emitNotify(QQmlNotifierEndpoint *, void * *) 0x7ffff6b8a80a 13 void doActivate<false>(QObject *, int, void * *) 0x7ffff55e4858 14 VDMAbstractItemModelDataType::notify(QQmlAdaptorModel const&, QList<QQmlDelegateModelItem *> const&, int, int, QList<int> const&) const 0x7ffff6f9c1d0 15 QQmlDelegateModel::_q_itemsChanged(int, int, QList<int> const&) 0x7ffff6fb3204 16 QQmlDelegateModel::qt_metacall(QMetaObject::Call, int, void * *) 0x7ffff6fb5204 17 void doActivate<false>(QObject *, int, void * *) 0x7ffff55e4f64 18 QAbstractItemModel::dataChanged(QModelIndex const&, QModelIndex const&, QList<int> const&) 0x7ffff57d78bc ... <More>