En esta página

QActionEvent Class

La clase QActionEvent proporciona un evento que se genera cuando se añade, elimina o cambia un QAction. Más...

Cabecera: #include <QActionEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
Hereda: QEvent

Funciones Públicas

QActionEvent(int type, QAction *action, QAction *before = nullptr)
QAction *action() const
QAction *before() const

Descripción Detallada

Se pueden añadir acciones a los controles, por ejemplo utilizando QWidget::addAction(). Esto genera un evento ActionAdded, que puedes manejar para proporcionar un comportamiento personalizado. Por ejemplo, QToolBar reimplementa QWidget::actionEvent() para crear QToolButtons para las acciones.

Véase también QAction, QWidget::addAction(), QWidget::removeAction(), y QWidget::actions().

Documentación de funciones miembro

QActionEvent::QActionEvent(int type, QAction *action, QAction *before = nullptr)

Construye un evento de acción. El type puede ser ActionChanged, ActionAdded, o ActionRemoved.

action es la acción que se modifica, añade o elimina. Si type es ActionAdded, la acción se insertará antes de la acción before. Si before es nullptr, la acción se añade.

QAction *QActionEvent::action() const

Devuelve la acción modificada, añadida o eliminada.

Véase también before().

QAction *QActionEvent::before() const

Si type() es ActionAdded, devuelve la acción que debería aparecer antes de action(). Si esta función devuelve nullptr, la acción debería añadirse a las acciones ya existentes en el mismo widget.

Véase también action() y QWidget::actions().

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.