diff --git a/src/imports/location/qdeclarativegeomapitembase.cpp b/src/imports/location/qdeclarativegeomapitembase.cpp index 8e825f5b4c9fb7dc4dee3e164146d000872b56e7..1788f740648f23c430583104dca2ab6d8b638718 100644 --- a/src/imports/location/qdeclarativegeomapitembase.cpp +++ b/src/imports/location/qdeclarativegeomapitembase.cpp @@ -198,18 +198,14 @@ float QDeclarativeGeoMapItemBase::zoomLevelOpacity() const bool QDeclarativeGeoMapItemBase::childMouseEventFilter(QQuickItem *item, QEvent *event) { Q_UNUSED(item) - switch (event->type()) { - case QEvent::MouseButtonPress: - case QEvent::MouseButtonRelease: - if (contains(static_cast<QMouseEvent*>(event)->pos())) { - return false; - } else { - event->setAccepted(false); - return true; - } - default: - return false; + if (event->type() == QEvent::MouseButtonPress && !contains(static_cast<QMouseEvent*>(event)->pos())) { + // This is an evil hack: in case of items that are not rectangles, we never accept the event. + // Instead the events are now delivered to QDeclarativeGeoMapItemBase which doesn't to anything with them. + // The map below it still works since it filters events and steals the events at some point. + event->setAccepted(false); + return true; } + return false; } /*!