

Returns the mouse cursor position in scene coordinates. QPointF QGraphicsSceneMouseEvent:: scenePos() const See also scenePos(), screenPos(), and lastPos(). Returns the mouse cursor position in item coordinates. QPointF QGraphicsSceneMouseEvent:: pos() const

Returns the keyboard modifiers in use at the time the event was sent. Qt::KeyboardModifiers QGraphicsSceneMouseEvent:: modifiers() const See also lastPos(), lastScenePos(), and screenPos(). The last recorded position is the position of the previous mouse event received by the view that created the event. Returns the last recorded mouse cursor position in screen coordinates. QPoint QGraphicsSceneMouseEvent:: lastScreenPos() const See also lastPos(), lastScreenPos(), and scenePos(). Returns the last recorded mouse cursor position in scene coordinates. QPointF QGraphicsSceneMouseEvent:: lastScenePos() const See also lastScenePos(), lastScreenPos(), and pos(). Returns the last recorded mouse cursor position in item coordinates. QPointF QGraphicsSceneMouseEvent:: lastPos() const See also Qt::MouseEventFlag and QMouseEvent::flags(). The mouse event flags provide additional information about a mouse event. Qt::MouseEventFlags QGraphicsSceneMouseEvent:: flags() const Returns the combination of mouse buttons that were pressed at the time the event was sent. Qt::MouseButtons QGraphicsSceneMouseEvent:: buttons() const See also screenPos(), buttonDownPos(), and buttonDownScenePos(). Returns the mouse cursor position in screen coordinates where the specified button was clicked. QPoint QGraphicsSceneMouseEvent:: buttonDownScreenPos( Qt::MouseButton button) const See also buttonDownPos(), buttonDownScreenPos(), and scenePos(). Returns the mouse cursor position in scene coordinates where the specified button was clicked.

QPointF QGraphicsSceneMouseEvent:: buttonDownScenePos( Qt::MouseButton button) const See also buttonDownScenePos(), buttonDownScreenPos(), and pos(). Returns the mouse cursor position in item coordinates where the specified button was clicked. QPointF QGraphicsSceneMouseEvent:: buttonDownPos( Qt::MouseButton button) const Returns the mouse button (if any) that caused the event. Qt::MouseButton QGraphicsSceneMouseEvent:: button() const You could probably hack something together like the below example that will basically change the anchors of the mouse area so that some of the time you use the mouse area to get screen coordinates, but other times you remove the mouse area and use the map signals.Ĭonsole.log("changed (from mouse area)") Ĭonsole.log("mouse position changed", mouse.Member Function Documentation QGraphicsSceneMouseEvent:: ~QGraphicsSceneMouseEvent()ĭestroys the event. If you need to have hovering built in, then the MouseArea limitation is a known limit at this time. It should pan and display screen coordinates.Ĭonsole.log("changed (from map signal)", mouse.x, mouse.y) Take the following example and touch the screen and move around the map. If detecting mouse position without hovering, then you should be fine to just use mousePositionChanged. Release notes for ArcGIS Runtime SDK 10.2.6 for Qt-ArcGIS Runtime SDK for Qt | ArcGIS for Developers Putting a mouse area over the map stops all mouse events from propagating to the map. On a touch screen, there isn't really a concept of hovering, so this isn't an issue here.Īs far as using the MouseArea over top of a Map, this is currently a known issue. The only caveat is that if you are using a desktop that has a mouse (as opposed to a touch mobile device), you need to actually press and hold the mouse to get the coordinates. We also have a mousePositionChanged signal that will let you know the screen coordinates of the mouse. Thanks!Ĭonsole.log("mouse position changed", mouse.x)Ĭan you provide a few more details? Are you making an app that will run on desktops, mobile devices, or both? Also, are you looking to display the screen coordinates of the mouse with just hovering and not clicking? We have several MouseEvent signals on the map that will let you know when the mouse is clicked, released, etc ArcGIS Runtime SDK for Qt QML API: Map Class Reference . If this works for you, please mark this as the correct answer as it is more straight forward than the previous suggestion. It's a few lines of code, but if you actually just create signal handlers for each mouse signal on the MouseArea, then don't accept the mouse, it looks like it will actually get sent down to the map. What happens right now is the mouse area intercepts all of the mouse signals, and accepts them, which results in them not going through to the map. Basically place the mouse area over top of the map, but don't accept any of the mouse events so that they actually get propagated to the map.
