Skip to content

Class QAccelPlot::PlotMouseEvent

ClassList > QAccelPlot > PlotMouseEvent

Carries mouse event data for the mouse signals. More...

  • #include <PlotMouseEvent.hpp>

Inherits the following classes: QObject

Inheritance diagram

flowchart TB
  classQAccelPlot_1_1PlotMouseEvent["QAccelPlot::PlotMouseEvent"]

  external_base_classQAccelPlot_1_1PlotMouseEvent_1["QObject"]
  external_base_classQAccelPlot_1_1PlotMouseEvent_1 --> classQAccelPlot_1_1PlotMouseEvent

Public Properties

Type Name
property bool accepted
Whether this event has been accepted by a handler. Read via isAccepted() ; set viaaccept() orignore() .
property Qt::MouseButton button
The mouse button that caused the event; Qt.NoButton for a move.
property Qt::MouseButtons buttons
The mouse buttons held down during the event.
property Qt::KeyboardModifiers modifiers
Active keyboard modifiers at the time of the event.
property qreal x
Item-local pixel X coordinate of the event.
property qreal y
Item-local pixel Y coordinate of the event.

Public Functions

Type Name
PlotMouseEvent (QObject * parent=nullptr)
Constructs a PlotMouseEvent with an optionalparent .
Q_INVOKABLE void accept ()
Accepts the event, suppressing the plot's built-in handling.
Qt::MouseButton button () const
Returns the mouse button that caused the event; Qt::NoButton for a move.
Qt::MouseButtons buttons () const
Returns the mouse buttons held down during the event.
Q_INVOKABLE void ignore ()
Ignores the event, allowing the plot's built-in handling to proceed.
bool isAccepted () const
Returns true if the event has been accepted by a handler.
Qt::KeyboardModifiers modifiers () const
Returns the active keyboard modifiers at the time of the event.
void setAccepted (bool accepted)
Sets whether the event is accepted. Equivalent to accept() ifaccepted is true, orignore() if false.
qreal x () const
Returns the item-local pixel X coordinate of the event.
qreal y () const
Returns the item-local pixel Y coordinate of the event.

Detailed Description

An instance of this class is passed to each mouse signal. Mirrors the Qt QEvent API: call accept() in a handler to consume the event and suppress the plot's built-in handling (dragging, double-click rescaling, etc.).

Note:

The object is owned by QAccelPlot and is reused across events — do not store a reference to it beyond the signal handler.

Public Properties Documentation

property accepted

Whether this event has been accepted by a handler. Read via isAccepted() ; set viaaccept() orignore() .

bool QAccelPlot::PlotMouseEvent::accepted;


property button

The mouse button that caused the event; Qt.NoButton for a move.

Qt::MouseButton QAccelPlot::PlotMouseEvent::button;


property buttons

The mouse buttons held down during the event.

Qt::MouseButtons QAccelPlot::PlotMouseEvent::buttons;


property modifiers

Active keyboard modifiers at the time of the event.

Qt::KeyboardModifiers QAccelPlot::PlotMouseEvent::modifiers;


property x

Item-local pixel X coordinate of the event.

qreal QAccelPlot::PlotMouseEvent::x;


property y

Item-local pixel Y coordinate of the event.

qreal QAccelPlot::PlotMouseEvent::y;


Public Functions Documentation

function PlotMouseEvent

Constructs a PlotMouseEvent with an optionalparent .

explicit QAccelPlot::PlotMouseEvent::PlotMouseEvent (
    QObject * parent=nullptr
) 


function accept

Accepts the event, suppressing the plot's built-in handling.

Q_INVOKABLE void QAccelPlot::PlotMouseEvent::accept () 


function button

Returns the mouse button that caused the event; Qt::NoButton for a move.

Qt::MouseButton QAccelPlot::PlotMouseEvent::button () const


function buttons

Returns the mouse buttons held down during the event.

Qt::MouseButtons QAccelPlot::PlotMouseEvent::buttons () const


function ignore

Ignores the event, allowing the plot's built-in handling to proceed.

Q_INVOKABLE void QAccelPlot::PlotMouseEvent::ignore () 


function isAccepted

Returns true if the event has been accepted by a handler.

bool QAccelPlot::PlotMouseEvent::isAccepted () const


function modifiers

Returns the active keyboard modifiers at the time of the event.

Qt::KeyboardModifiers QAccelPlot::PlotMouseEvent::modifiers () const


function setAccepted

Sets whether the event is accepted. Equivalent to accept() ifaccepted is true, orignore() if false.

void QAccelPlot::PlotMouseEvent::setAccepted (
    bool accepted
) 


function x

Returns the item-local pixel X coordinate of the event.

qreal QAccelPlot::PlotMouseEvent::x () const


function y

Returns the item-local pixel Y coordinate of the event.

qreal QAccelPlot::PlotMouseEvent::y () const



The documentation for this class was generated from the following file QAccelPlot/src/QAccelPlot/PlotMouseEvent.hpp