QActionEvent Class Reference

[ QtGui module]

The QActionEvent class provides an event that is generated when a QAction 被添加、被移除或被改变时。 更多...

继承 QEvent .

方法


详细描述

The QActionEvent class provides an event that is generated when a QAction is added, removed, or 改变。

动作可以被添加到 Widget,使用 QWidget.addAction (). This generates an ActionAdded event, which you can handle to provide custom behavior. For example, QToolBar reimplements QWidget.actionEvent () to create QToolButton s for the actions.


方法文档编制

QActionEvent.__init__ ( self , int  type , QAction   action , QAction   before  = None)

构造动作事件。 type 可以是 ActionChanged , ActionAdded ,或 ActionRemoved .

action is the action that is changed, added, or removed. 若 type is ActionAdded , the action is to be inserted before the action before 。若 before is 0, the action is appended.

QActionEvent.__init__ ( self , QActionEvent )

QAction QActionEvent.action ( self )

返回被改变、被添加或被被删除的动作。

另请参阅 before ().

QAction QActionEvent.before ( self )

type () 是 ActionAdded , returns the action that should appear before action ()。若此函数返回 0, the action should be appended to already existing actions on the same widget.

另请参阅 action () and QWidget.actions ().