C++ (Qt)QAction * findAction(QObjectList lst, QString menuname){ for( QObjectList::const_iterator it = lst.begin(); it != lst.end(); ++it ) { if( QAction *act = qobject_cast<QAction*>(*it) ) { QString name = act->objectName(); if( menuname.compare( name, Qt::CaseInsensitive ) == 0 ) return act; } else if( QMenu *mnu = qobject_cast<QMenu*>(*it) ) { QAction * act = findAction(mnu->children(), menuname); if( act != 0 ) return act; } } return 0;} QAction * act = findAction(this->menuBar()->children());