QActionEvent Class Reference

[QtGui module]

该QActionEvent类提供了产生一个事件时,QAction添加,删除或更改。More…

继承QEvent

Methods

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

Detailed Description

该QActionEvent类提供了产生一个事件时,QAction添加,删除或更改。

操作可以使用被添加到小部件QWidget.addAction( ) 。这将生成一个ActionAdded事件,您可以处理,以提供自定义行为。例如,QToolBar重新实现QWidget.actionEvent( )来创建QToolButtonS为行动。


Method Documentation

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

构造一个动作事件。该type可以ActionChangedActionAddedActionRemoved

action是改变的动作,添加或删除。如果type is ActionAdded,动作是动作之前插入before。如果before为0时,动作被追加。

  1. QActionEvent.__init__ (self, QActionEvent)
  1. QAction QActionEvent.action (self)

[

返回更改,添加或删除的动作。

]($docs-qaction.html)

See also before( ) 。

  1. QAction QActionEvent.before (self)

If type()是ActionAdded,返回应该出现在这之前的动作action( ) 。如果这个函数返回0时,动作应被追加到已有的同一部件的动作。

See also action()和QWidget.actions( ) 。