summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2019-01-09 13:37:37 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2019-01-11 13:51:03 +0000
commitbe55fa95765c0d53fadddfce2e9aefa651cf791d (patch)
treebf17d292ded47619c5ef3e921fbde401e825accb
parent1688c44d223145abfdca19a7b31faecbafb0d315 (diff)
downloadqtlocation-be55fa95765c0d53fadddfce2e9aefa651cf791d.tar.gz
Fix crash when assigning a Component to MapQuickItem.sourceItem
This workaround is currently needed until QTBUG-72930 gets fixed in qtdeclarative. Change-Id: Id75fa2048dd6e012c99f61cdc07cfedbe8c6bf83 Fixes: QTBUG-61509 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapquickitem.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp b/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp
index 8c71e7be..5f9ecc8a 100644
--- a/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp
@@ -249,9 +249,10 @@ QGeoCoordinate QDeclarativeGeoMapQuickItem::coordinate()
*/
void QDeclarativeGeoMapQuickItem::setSourceItem(QQuickItem *sourceItem)
{
- if (sourceItem_.data() == sourceItem)
+ QQuickItem *item = qobject_cast<QQuickItem *>(sourceItem); // Workaround for QTBUG-72930
+ if (sourceItem_.data() == item)
return;
- sourceItem_ = sourceItem;
+ sourceItem_ = item;
polishAndUpdate();
emit sourceItemChanged();
}