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はEventクラスの一部です。
パブリック関数
QActionEvent(int type, QAction *action, QAction *before = nullptr) | |
QAction * | action() const |
QAction * | before() const |
詳細説明
アクションは、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 は変更、追加、削除されるアクションである。 が ActionAdded の場合、アクションはアクション の前に挿入される。 が の場合、アクションは追加される。type before before nullptr
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.