Struct qt_gui::action_event::ActionEvent
source · #[repr(C)]pub struct ActionEvent(_);
Expand description
C++ type: QActionEvent
The QActionEvent class provides an event that is generated when a QAction is added, removed, or changed.
Actions can be added to widgets using QWidget::addAction(). This generates an ActionAdded event, which you can handle to provide custom behavior. For example, QToolBar reimplements QWidget::actionEvent() to create QToolButtons for the actions.
Methods from Deref<Target = Event>§
sourcepub fn accept(&mut self)
pub fn accept(&mut self)
C++ method: void QEvent::accept()
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.
See also ignore().
sourcepub fn ignore(&mut self)
pub fn ignore(&mut self)
C++ method: void QEvent::ignore()
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.
See also accept().
sourcepub fn is_accepted(&self) -> bool
pub fn is_accepted(&self) -> bool
C++ method: bool QEvent::isAccepted() const
the accept flag of the event object
Setting the accept parameter indicates that the event receiver wants the event. Unwanted events might be propagated to the parent widget. By default, isAccepted() is set to true, but don't rely on this as subclasses may choose to clear it in their constructor.
For convenience, the accept flag can also be set with accept(), and cleared with ignore().
Access functions:
bool | isAccepted() const |
void | setAccepted(bool accepted) |
sourcepub fn op_assign<'l0, 'l1>(&'l0 mut self, other: &'l1 Event) -> &'l0 mut Event
pub fn op_assign<'l0, 'l1>(&'l0 mut self, other: &'l1 Event) -> &'l0 mut Event
C++ method: QEvent& QEvent::operator=(const QEvent& other)
sourcepub fn set_accepted(&mut self, accepted: bool)
pub fn set_accepted(&mut self, accepted: bool)
C++ method: void QEvent::setAccepted(bool accepted)
the accept flag of the event object
Setting the accept parameter indicates that the event receiver wants the event. Unwanted events might be propagated to the parent widget. By default, isAccepted() is set to true, but don't rely on this as subclasses may choose to clear it in their constructor.
For convenience, the accept flag can also be set with accept(), and cleared with ignore().
Access functions:
bool | isAccepted() const |
void | setAccepted(bool accepted) |
sourcepub fn spontaneous(&self) -> bool
pub fn spontaneous(&self) -> bool
C++ method: bool QEvent::spontaneous() const
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.