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는 이벤트 클래스의 일부입니다.
공개 함수
| QActionEvent(int type, QAction *action, QAction *before = nullptr) | |
| QAction * | action() const |
| QAction * | before() const |
보호된 함수
| QActionEvent(QActionEvent &&) | |
| QActionEvent & | operator=(QActionEvent &&) |
| QActionEvent & | operator=(const QActionEvent &other) |
상세 설명
예를 들어, ` QWidget::addAction()`를 사용하여 컨트롤에 액션을 추가할 수 있습니다. 이렇게 하면 ` ActionAdded ` 이벤트가 생성되며, 이 이벤트를 처리하여 사용자 정의 동작을 제공할 수 있습니다. 예를 들어, ` QToolBar `는 ` QWidget::actionEvent()`를 재구현하여 액션에 대한 ` QToolButton`를 생성합니다.
QAction, QWidget::addAction(), QWidget::removeAction(), QWidget::actions()도 참조하십시오 .
멤버 함수 문서
QActionEvent::QActionEvent(int type, QAction *action, QAction *before = nullptr)
액션 이벤트를 생성합니다. ` type `는 ` ActionChanged`, ` ActionAdded` 또는 ` ActionRemoved` 중 하나일 수 있습니다.
action 는 변경, 추가 또는 제거되는 액션입니다. type 가 ActionAdded인 경우, 해당 액션은 before 액션 앞에 삽입됩니다. before 가 nullptr 인 경우, 해당 액션은 끝에 추가됩니다.
[protected delete] QActionEvent::QActionEvent(QActionEvent &&)
QActionEvent 의 인스턴스를 move-construct로 생성합니다. 이 함수는 삭제되었습니다.
QAction *QActionEvent::action() const
변경, 추가 또는 제거된 액션을 반환합니다.
before()도 참조하십시오 .
QAction *QActionEvent::before() const
type()의 결과가 ActionAdded 인 경우, action()보다 먼저 실행되어야 할 액션을 반환합니다. 이 함수가 nullptr 를 반환하면, 해당 액션은 동일한 위젯에 이미 존재하는 액션들 뒤에 추가되어야 합니다.
action() 및 QWidget::actions()도 참조하십시오 .
[protected delete] QActionEvent &QActionEvent::operator=(QActionEvent &&)
other 를 이 QActionEvent 인스턴스에 할당합니다. 이 함수는 삭제됩니다.
[noexcept protected default] QActionEvent &QActionEvent::operator=(const QActionEvent &other)
other 를 이 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.