PDA

View Full Version : access menubar items by name



navid
6th December 2009, 04:26
hi
how can I access menubar items by their action names?

regrads
navid

wysota
6th December 2009, 09:21
If you don't have pointers to all the actions in your menu then you can store them in a QHash<QString,QAction*> or you can use qFindChild() to find an object by name knowing its type and parent.

axeljaeger
7th December 2009, 13:15
Be carefull: There is no mechanism that prevents you from creating two actions with the same name. You cannot be sure that the object name is a unique identifier.