Subgroup: Layout

Class: QgsLayoutViewMouseEvent

class qgis.gui.QgsLayoutViewMouseEvent

Bases: PyQt5.QtGui.QMouseEvent

A QgsLayoutViewMouseEvent is the result of a user interaction with the mouse on a QgsLayoutView.

It is sent whenever the user moves, clicks, releases or double clicks the mouse. In addition to the coordinates in pixel space it also knows the coordinates the layout space.

New in version 3.0: Methods

accept
button
buttons
flags
globalPos
globalX
globalY
ignore
isAccepted
isSnapped Returns true if point was snapped, e.g.
layoutPoint Returns the event point location in layout coordinates.
localPos
modifiers
pos
registerEventType
screenPos
setAccepted
setTimestamp
snapPoint Manually triggers a snap for the mouse event position using the layout’s snapper.
snappedPoint Returns the snapped event point location in layout coordinates.
source
spontaneous
timestamp
type
windowPos
x
y

Attributes

ActionAdded
ActionChanged
ActionRemoved
ActivationChange
ApplicationActivate
ApplicationActivated
ApplicationDeactivate
ApplicationDeactivated
ApplicationFontChange
ApplicationLayoutDirectionChange
ApplicationPaletteChange
ApplicationStateChange
ApplicationWindowIconChange
ChildAdded
ChildPolished
ChildRemoved
Clipboard
Close
CloseSoftwareInputPanel
ContentsRectChange
ContextMenu
CursorChange
DeferredDelete
DragEnter
DragLeave
DragMove
Drop
DynamicPropertyChange
EnabledChange
Enter
EnterWhatsThisMode
Expose
FileOpen
FocusAboutToChange
FocusIn
FocusOut
FontChange
Gesture
GestureOverride
GrabKeyboard
GrabMouse
GraphicsSceneContextMenu
GraphicsSceneDragEnter
GraphicsSceneDragLeave
GraphicsSceneDragMove
GraphicsSceneDrop
GraphicsSceneHelp
GraphicsSceneHoverEnter
GraphicsSceneHoverLeave
GraphicsSceneHoverMove
GraphicsSceneMouseDoubleClick
GraphicsSceneMouseMove
GraphicsSceneMousePress
GraphicsSceneMouseRelease
GraphicsSceneMove
GraphicsSceneResize
GraphicsSceneWheel
Hide
HideToParent
HoverEnter
HoverLeave
HoverMove
IconDrag
IconTextChange
InputMethod
InputMethodQuery
KeyPress
KeyRelease
KeyboardLayoutChange
LanguageChange
LayoutDirectionChange
LayoutRequest
Leave
LeaveWhatsThisMode
LocaleChange
MacSizeChange
MaxUser
MetaCall
ModifiedChange
MouseButtonDblClick
MouseButtonPress
MouseButtonRelease
MouseMove
MouseTrackingChange
Move
NonClientAreaMouseButtonDblClick
NonClientAreaMouseButtonPress
NonClientAreaMouseButtonRelease
NonClientAreaMouseMove
None_
OkRequest
OrientationChange
Paint
PaletteChange
ParentAboutToChange
ParentChange
PlatformPanel
PlatformSurface
Polish
PolishRequest
QueryWhatsThis
ReadOnlyChange
RequestSoftwareInputPanel
Resize
Scroll
ScrollPrepare
Shortcut
ShortcutOverride
Show
ShowToParent
SockAct
StateMachineSignal
StateMachineWrapped
StatusTip
StyleChange
TabletEnterProximity
TabletLeaveProximity
TabletMove
TabletPress
TabletRelease
TabletTrackingChange
ThreadChange
Timer
ToolBarChange
ToolTip
ToolTipChange
TouchBegin
TouchCancel
TouchEnd
TouchUpdate
UngrabKeyboard
UngrabMouse
UpdateLater
UpdateRequest
User
WhatsThis
WhatsThisClicked
Wheel
WinEventAct
WinIdChange
WindowActivate
WindowBlocked
WindowDeactivate
WindowIconChange
WindowStateChange
WindowTitleChange
WindowUnblocked
ZOrderChange
isSnapped(self) → bool

Returns true if point was snapped, e.g. to grid or guide lines.

See also

snappedPoint()

layoutPoint(self) → QPointF

Returns the event point location in layout coordinates.

See also

pos()

snapPoint(self, horizontalSnapLine: QGraphicsLineItem = None, verticalSnapLine: QGraphicsLineItem = None, ignoreItems: Iterable[QgsLayoutItem] = [])

Manually triggers a snap for the mouse event position using the layout’s snapper.

If the horizontalSnapLine and verticalSnapLine arguments are specified, then the snapper will automatically display and position these lines to indicate snapping positions to item bounds.

The ignoreItems argument can be used to specify a list of items to avoid snapping to.

snappedPoint(self) → QPointF

Returns the snapped event point location in layout coordinates. The snapped point will consider all possible snapping methods, such as snapping to grid or guide lines.

See also

isSnapped()

See also

pos()