以下成员源于类 QActionGroup are part of the Qt compatibility layer. We advise against using them in new code.
| void | add (QAction * a ) |
| void | addSeparator () |
| bool | addTo (QWidget * widget ) |
| void | selected (QAction * action ) |
使用 addAction () 代替。
Normally you add a separator to the menus or widgets to which actions are added, so this function is very rarely needed.
例如,若有代码像
actionGroup->addSeparator();
可以把它重写成
QAction *separator = new QAction(this); separator->setSeparator(true); actionGroup->addAction(separator);
例如,若有代码像
actionGroup->addTo(widget);
可以把它重写成
widget->addActions(actionGroup->actions());
[signal]
void
QActionGroup::
selected
(
QAction
*
action
)
使用 triggered () 代替。