QActionEvent Class

QActionEvent 클래스는 QAction 가 추가, 제거 또는 변경될 때 생성되는 이벤트를 제공합니다. 더 보기...

헤더: #include <QActionEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
상속합니다: QEvent

공용 함수

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

자세한 설명

예를 들어 QWidget::addAction()를 사용하여 액션을 컨트롤에 추가할 수 있습니다. 그러면 ActionAdded 이벤트가 생성되며, 이 이벤트를 처리하여 사용자 지정 동작을 제공할 수 있습니다. 예를 들어 QToolBarQWidget::actionEvent()를 재구현하여 동작에 대한 QToolButton를 생성합니다.

QAction, QWidget::addAction(), QWidget::removeAction() 및 QWidget::actions()도 참조하세요 .

멤버 함수 문서

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

액션 이벤트를 생성합니다. typeActionChanged, ActionAdded 또는 ActionRemoved 일 수 있습니다.

action 는 변경, 추가 또는 제거되는 액션입니다. type 이 ActionAdded인 경우 before 액션 앞에 액션이 삽입됩니다. beforenullptr 인 경우 액션이 추가됩니다.

QAction *QActionEvent::action() const

변경, 추가 또는 제거된 작업을 반환합니다.

before()도 참조하세요 .

QAction *QActionEvent::before() const

type()가 ActionAdded 인 경우 action() 앞에 표시되어야 하는 액션을 반환합니다. 이 함수가 nullptr 를 반환하면 동일한 위젯에 이미 존재하는 액션에 액션이 추가되어야 합니다.

action() 및 QWidget::actions()도 참조하세요 .

© 2025 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.