QActionEvent Class
La clase `QActionEvent` proporciona un evento que se genera cuando se añade, se elimina o se modifica un ` QAction `. Más información...
| Encabezado: | #include <QActionEvent> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
| qmake: | QT += gui |
| Heredan: | QEvent |
- Lista de todos los miembros, incluidos los heredados
- QActionEvent forma parte de las clases de eventos.
Funciones públicas
| QActionEvent(int type, QAction *action, QAction *before = nullptr) | |
| QAction * | action() const |
| QAction * | before() const |
Funciones protegidas
| QActionEvent(QActionEvent &&) | |
| QActionEvent & | operator=(QActionEvent &&) |
| QActionEvent & | operator=(const QActionEvent &other) |
Descripción detallada
Se pueden añadir acciones a los controles, por ejemplo, utilizando QWidget::addAction(). Esto genera un evento ActionAdded, que puedes gestionar para proporcionar un comportamiento personalizado. Por ejemplo, QToolBar reimplementa QWidget::actionEvent() para crear QToolButtonpara las acciones.
Véase también QAction, QWidget::addAction(), QWidget::removeAction() y QWidget::actions().
Documentación de funciones de miembro
QActionEvent::QActionEvent(int type, QAction *action, QAction *before = nullptr)
Crea un evento de acción. El parámetro « type » puede tomar los valores « 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ñadirá al final.
[protected delete] QActionEvent::QActionEvent(QActionEvent &&)
Crea una instancia de ` QActionEvent`. Esta función se ha eliminado.
QAction *QActionEvent::action() const
Devuelve la acción que se ha modificado, añadido o eliminado.
Véase también before().
QAction *QActionEvent::before() const
Si type() devuelve ActionAdded, devuelve la acción que debe aparecer antes de action(). Si esta función devuelve nullptr, la acción debe añadirse al final de las acciones ya existentes en el mismo widget.
Véanse también action() y QWidget::actions().
[protected delete] QActionEvent &QActionEvent::operator=(QActionEvent &&)
Asigna mediante «move» other a esta instancia de QActionEvent. Esta función se elimina.
[noexcept protected default] QActionEvent &QActionEvent::operator=(const QActionEvent &other)
Asigna mediante copia other a esta instancia de QActionEvent.
© 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.