From a6be180f8f4defd9f6341f4ca089d3e22df431e6 Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Wed, 5 Jul 2017 12:35:50 +0200 Subject: Do not draw mapQuickItems if coordinate_ is invalid This change also reverts a4dc11fd52f42676265cff2ff9396a7396f1ccb3 Task-number: QTBUG-61070 Change-Id: I2046356e339b5889860b3dce10627d6b736ac02f Reviewed-by: Alex Blasche --- src/location/declarativemaps/qdeclarativegeomapquickitem.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp b/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp index 86d67cf8..7c0764aa 100644 --- a/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp +++ b/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp @@ -159,7 +159,7 @@ QDeclarativeGeoMapQuickItem::~QDeclarativeGeoMapQuickItem() {} */ void QDeclarativeGeoMapQuickItem::setCoordinate(const QGeoCoordinate &coordinate) { - if (coordinate_ == coordinate || !coordinate.isValid()) + if (coordinate_ == coordinate) return; coordinate_ = coordinate; @@ -378,6 +378,13 @@ void QDeclarativeGeoMapQuickItem::updatePolish() this, SLOT(polishAndUpdate())); } + if (!coordinate_.isValid()) { + opacityContainer_->setVisible(false); + return; + } else { + opacityContainer_->setVisible(true); + } + QScopedValueRollback rollback(updatingGeometry_); updatingGeometry_ = true; -- cgit v1.2.1