diff options
author | Liang Qi <liang.qi@qt.io> | 2018-01-26 10:02:03 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-01-26 10:18:14 +0100 |
commit | 518633da419d6cfaf603773b9e8c5840e783bc4a (patch) | |
tree | 326ffd3f5497be64e38fa420af016867ada00538 /src/location/declarativemaps/qdeclarativegeomapitembase.cpp | |
parent | 9283a290040fd55f7eb34580b99f771d4facdeb4 (diff) | |
parent | 68b5ee9e7064f66fd7e7bd69b4b51229dbe8cc3c (diff) | |
download | qtlocation-518633da419d6cfaf603773b9e8c5840e783bc4a.tar.gz |
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp
tests/plugins/declarativetestplugin/testhelper.h
Change-Id: Ie218ab1dc68642a6922e05e5688c20b90440b72e
Diffstat (limited to 'src/location/declarativemaps/qdeclarativegeomapitembase.cpp')
-rw-r--r-- | src/location/declarativemaps/qdeclarativegeomapitembase.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomapitembase.cpp b/src/location/declarativemaps/qdeclarativegeomapitembase.cpp index 729825fd..bb503cd3 100644 --- a/src/location/declarativemaps/qdeclarativegeomapitembase.cpp +++ b/src/location/declarativemaps/qdeclarativegeomapitembase.cpp @@ -214,9 +214,14 @@ bool QDeclarativeGeoMapItemBase::childMouseEventFilter(QQuickItem *item, QEvent { Q_UNUSED(item) 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. + // In case of items that are not rectangles, this filter is used to test if the event has landed + // inside the actual item shape. + // If so, the method returns true, meaning that it prevents the event delivery to child "*item" (for example, + // a mouse area that is on top of this map item). + // However, this method sets "accepted" to false, so that the event can still be passed further up, + // specifically to the parent Map, that is a sort of flickable. + // Otherwise, if the event is not contained within the map item, the method returns false, meaning the event + // is delivered to the child *item (like the mouse area associated). event->setAccepted(false); return true; } |