[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r3454: If the mouse is clicked on a map location with one or more f (vidalia/branches/marble/src/vidalia/network)
Author: edmanm
Date: 2009-01-17 21:38:30 -0500 (Sat, 17 Jan 2009)
New Revision: 3454
Modified:
vidalia/branches/marble/src/vidalia/network/tormapwidgetinputhandler.cpp
vidalia/branches/marble/src/vidalia/network/tormapwidgetinputhandler.h
Log:
If the mouse is clicked on a map location with one or more features, emit a
featureClicked() signal to indicate the mouse position and which button was
clicked.
Modified: vidalia/branches/marble/src/vidalia/network/tormapwidgetinputhandler.cpp
===================================================================
--- vidalia/branches/marble/src/vidalia/network/tormapwidgetinputhandler.cpp 2009-01-18 01:53:27 UTC (rev 3453)
+++ vidalia/branches/marble/src/vidalia/network/tormapwidgetinputhandler.cpp 2009-01-18 02:38:30 UTC (rev 3454)
@@ -55,7 +55,9 @@
_mousePressedLon = m_widget->centerLongitude();
_mousePressedLat = m_widget->centerLatitude();
- if (! pointHasFeatures(mouseEvent->pos()))
+ if (pointHasFeatures(mouseEvent->pos()))
+ emit featureClicked(mouseEvent->pos(), mouseEvent->button());
+ else
m_widget->setCursor(Qt::ClosedHandCursor);
break;
Modified: vidalia/branches/marble/src/vidalia/network/tormapwidgetinputhandler.h
===================================================================
--- vidalia/branches/marble/src/vidalia/network/tormapwidgetinputhandler.h 2009-01-18 01:53:27 UTC (rev 3453)
+++ vidalia/branches/marble/src/vidalia/network/tormapwidgetinputhandler.h 2009-01-18 02:38:30 UTC (rev 3454)
@@ -27,6 +27,12 @@
*/
TorMapWidgetInputHandler();
+signals:
+ /** Emitted when the user clicks on a map feature located at <b>point</b>.
+ * <b>button</b> indicates which mouse button was clicked.
+ */
+ void featureClicked(const QPoint &point, Qt::MouseButton button);
+
protected:
/** Filter and handles event <b>e</b> that was sent to widget <b>obj</b>.
* <b>obj</b> is always a MarbleWidget object.
@@ -34,6 +40,9 @@
virtual bool eventFilter(QObject *obj, QEvent *e);
private:
+ /** Returns true if the map has one or more features located at the screen
+ * position <b>point</b>.
+ */
bool pointHasFeatures(const QPoint &point) const;
int _mousePressedX;