没办法了,使用QAction*->menu()!=NULL来判定的。。 QList<QAction*> actionList = ui->menu_L->actions();
QList<QString> stringList;
QAction * actiontemp = NULL;
foreach (actiontemp, actionList) {
QString strTemp = actiontemp->text();
if(strTemp == "Add")
{
;
}
else if(actiontemp->menu()!=NULL)
{
ChangReadRecio(stringList,actiontemp->menu(),strTemp);
}
else
{
stringList.push_back(strTemp);
}
}