From kde-commits Sat Jul 31 21:18:12 2010 From: Michael Georg Hansen Date: Sat, 31 Jul 2010 21:18:12 +0000 To: kde-commits Subject: branches/extragear/graphics/libkmap/libkmap Message-Id: <20100731211812.0FE60AC783 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=128061113908958 SVN commit 1157691 by mghansen: Fix appearance of left click menu in selection mode in Marble trunk. M +4 -16 backend-marble.cpp --- branches/extragear/graphics/libkmap/libkmap/backend-marble.cpp #1157690:1157691 @@ -816,7 +816,7 @@ && (event->type() != QEvent::MouseMove) && (event->type() != QEvent::MouseButtonRelease) ) { - return false; + return QObject::eventFilter(object, event); } QMouseEvent* const mouseEvent = static_cast(event); @@ -824,24 +824,17 @@ if(d->currentMouseMode == MouseModeSelection) { - - /* if ( ( event->type() == QEvent::MouseButtonPress ) && ( mouseEvent->button()==Qt::LeftButton ) ) { - //TODO: mouseEvent->pos() is enough? - //if(!d->firstSelectionPoint.hasCoordinates()) - //{ - // geoCoordinates(mouseEvent->pos(), &d->firstSelectionPoint); - // kDebug()<<"First selection point:"<firstSelectionPoint.lat()<<" "<firstSelectionPoint.lon(); - //} + // we need to filter this event because otherwise Marble displays + // a left click context menu doFilterEvent = true; } - else*/ if (event->type() == QEvent::MouseMove) + else if (event->type() == QEvent::MouseMove) { if(d->firstSelectionPoint.hasCoordinates() && !d->secondSelectionPoint.hasCoordinates()) { - d->intermediateSelectionPoint.clear(); geoCoordinates(mouseEvent->pos(), &d->intermediateSelectionPoint); @@ -850,7 +843,6 @@ qreal lonEast = d->intermediateSelectionPoint.lon(); qreal latSouth = d->intermediateSelectionPoint.lat(); - if(lonWest > lonEast) { const qreal auxCoord = lonWest; @@ -876,7 +868,6 @@ else if ( (event->type() == QEvent::MouseButtonRelease) && ( mouseEvent->button() == Qt::LeftButton ) ) { - if(!d->firstSelectionPoint.hasCoordinates()) { geoCoordinates(mouseEvent->pos(), &d->firstSelectionPoint); @@ -919,11 +910,9 @@ doFilterEvent = true; } - } else { - if ( ( event->type() == QEvent::MouseButtonPress ) && ( mouseEvent->button()==Qt::LeftButton ) ) { @@ -1101,7 +1090,6 @@ d->marbleWidget->update(); s->haveMovingCluster = false; } - } if (doFilterEvent)