QMouseEvent
Hierarchy
↳ QMouseEvent
Index
Constructors
Properties
Methods
- accept
- button
- buttons
- globalPosition
- globalX
- globalY
- ignore
- isAccepted
- modifiers
- position
- scenePosition
- setAccepted
- spontaneous
- timestamp
- type
- x
- y
Constructors
constructor
+ new QMouseEvent(event
: NativeRawPointer‹"QEvent"›): QMouseEvent
Overrides QEvent.constructor
Parameters:
Name | Type |
---|---|
event | NativeRawPointer‹"QEvent"› |
Returns: QMouseEvent
Properties
native
• native: NativeElement
Methods
accept
▸ accept(): void
Sets the accept flag of the event object, the equivalent of calling setAccepted(true). Setting the accept parameter indicates that the event receiver wants the event. Unwanted events might be propagated to the parent widget
Returns: void
button
▸ button(): number
Inherited from QSinglePointEvent.button
Returns: number
buttons
▸ buttons(): number
Inherited from QSinglePointEvent.buttons
Returns: number
globalPosition
▸ globalPosition(): object
Inherited from QSinglePointEvent.globalPosition
Returns the global position of the mouse pointer at the time of the event. This is important on asynchronous window systems such as X11; whenever you move your widgets around in response to mouse events, globalPosition() can differ a lot from the current cursor position returned by QCursor::pos().
Returns: object
-
x: number
-
y: number
globalX
▸ globalX(): number
Returns: number
globalY
▸ globalY(): number
Returns: number
ignore
▸ ignore(): void
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false). Clearing the accept parameter indicates that the event receiver does not want the event. Unwanted events might be propagated to the parent widget.
Returns: void
isAccepted
▸ isAccepted(): boolean
Inherited from QEvent.isAccepted
Returns: boolean
modifiers
▸ modifiers(): KeyboardModifier
Inherited from QInputEvent.modifiers
Returns: KeyboardModifier
position
▸ position(): object
Inherited from QSinglePointEvent.position
Returns the position of the mouse cursor relative to the widget that received the event. If you move your widgets around in response to mouse events, use globalPosition() instead of this function. This function was introduced in Qt 5.14
Returns: object
-
x: number
-
y: number
scenePosition
▸ scenePosition(): object
Inherited from QSinglePointEvent.scenePosition
Returns: object
-
x: number
-
y: number
setAccepted
▸ setAccepted(accepted
: boolean): void
Inherited from QEvent.setAccepted
Sets the accept flag of the event object
Parameters:
Name | Type |
---|---|
accepted | boolean |
Returns: void
spontaneous
▸ spontaneous(): boolean
Inherited from QEvent.spontaneous
Returns true if the event originated outside the application (a system event); otherwise returns false.
The return value of this function is not defined for paint events.
Returns: boolean
timestamp
▸ timestamp(): number
Inherited from QInputEvent.timestamp
Returns: number
type
▸ type(): number
Returns the event type
Returns: number
This is QEvent::Type
x
▸ x(): number
Returns: number
y
▸ y(): number
Returns: number