Compatibility Members for QAction

以下成员源于类 QAction are part of the Qt compatibility layer. We advise against using them in new code.

公共函数

QAction (QObject * parent , const char * name )
QAction (const QString & text , const QKeySequence & shortcut , QObject * parent , const char * name )
QAction (const QIcon & icon , const QString & text , const QKeySequence & shortcut , QObject * parent , const char * name )
QKeySequence accel () const
bool addTo (QWidget * w )
QIcon iconSet () const
bool isOn () const
bool isToggleAction () const
QString menuText () const
bool removeFrom (QWidget * w )
void setAccel (const QKeySequence & shortcut )
void setIconSet (const QIcon & i )
void setMenuText (const QString & text )
void setToggleAction (bool b )

公共槽

void setOn (bool b )

信号

void activated (int i = 0)

成员函数文档编制

QAction:: QAction ( QObject * parent , const char * name )

Use one of the QAction constructors that doesn't take a name argument and call setObjectName () 代替。

QAction:: QAction (const QString & text , const QKeySequence & shortcut , QObject * parent , const char * name )

Use one of the QAction constructors that doesn't take a name argument and call setObjectName () 代替。

QAction:: QAction (const QIcon & icon , const QString & text , const QKeySequence & shortcut , QObject * parent , const char * name )

Use one of the QAction constructors that doesn't take a name argument and call setObjectName () 代替。

QKeySequence QAction:: accel () const

使用 shortcut () 代替。

另请参阅 setAccel ().

[signal] void QAction:: activated ( int i = 0)

使用 triggered () 代替。

bool QAction:: addTo ( QWidget * w )

使用 QWidget::addAction () 代替。

例如,若有代码像

action->addTo(widget);
					

可以把它重写成

widget->addAction(action);
					

QIcon QAction:: iconSet () const

使用 icon () 代替。

另请参阅 setIconSet ().

bool QAction:: isOn () const

使用 isChecked () 代替。

bool QAction:: isToggleAction () const

使用 isCheckable () 代替。

使用 text () 代替。

另请参阅 setMenuText ().

bool QAction:: removeFrom ( QWidget * w )

使用 QWidget::removeAction () 代替。

例如,若有代码像

action->removeFrom(widget);
					

可以把它重写成

widget->removeAction(action);
					

void QAction:: setAccel (const QKeySequence & shortcut )

使用 setShortcut () 代替。

另请参阅 accel ().

void QAction:: setIconSet (const QIcon & i )

使用 setIcon () 代替。

另请参阅 iconSet ().

void QAction:: setMenuText (const QString & text )

使用 setText () 代替。

另请参阅 menuText ().

[slot] void QAction:: setOn ( bool b )

使用 setChecked () 代替。

另请参阅 isOn ().

void QAction:: setToggleAction ( bool b )

使用 setCheckable () 代替。

另请参阅 isToggleAction ().