\param pid parent menu item ID
\return \c true if parent menu item contains such child item
*/
-bool QtxActionMenuMgr::containsMenu( const QString& title, const int pid ) const
+bool QtxActionMenuMgr::containsMenu( const QString& title, const int pid, const bool rec ) const
{
- return (bool)find( title, pid, false );
+ return (bool)find( title, pid, rec );
}
/*!
\param pid parent menu item ID
\return \c true if parent menu item contains such child item
*/
-bool QtxActionMenuMgr::containsMenu( const int id, const int pid ) const
+bool QtxActionMenuMgr::containsMenu( const int id, const int pid, const bool rec ) const
{
- return (bool)find( id, pid, false );
+ return (bool)find( id, pid, rec );
}
/*!
virtual bool load( const QString&, QtxActionMgr::Reader& );
- bool containsMenu( const QString&, const int ) const;
- bool containsMenu( const int, const int ) const;
+ bool containsMenu( const QString&, const int, const bool = false ) const;
+ bool containsMenu( const int, const int, const bool = false ) const;
QMenu* findMenu( const int ) const;
return id;
}
+QList<QAction*> SUIT_Application::actions() const
+{
+ return myActionMap.values();
+}
+
+QList<int> SUIT_Application::actionIds() const
+{
+ return myActionMap.keys();
+}
+
/*!
Creates action and registers it both in menu manager and tool manager
\return new instance of action
\param member - slot to be called when action is activated
*/
QAction* SUIT_Application::createAction( const int id, const QString& text, const QIcon& icon,
- const QString& menu, const QString& tip, const int key,
+ const QString& menu, const QString& tip, const QKeySequence& key,
QObject* parent, const bool toggle, QObject* reciever, const char* member )
{
- QtxAction* a = new QtxAction( text, icon, menu, key, parent, toggle );
+ QtxAction* a = new QtxAction( text, icon, menu, 0, parent, toggle );
a->setStatusTip( tip );
+ a->setShortcut( key );
if ( reciever && member )
connect( a, SIGNAL( triggered( bool ) ), reciever, member );
class QString;
class QAction;
class QWidget;
+class QKeySequence;
+class SUIT_Study;
class SUIT_Desktop;
class SUIT_ViewModel;
class SUIT_ResourceMgr;
-class SUIT_Study;
#ifdef WIN32
#pragma warning ( disable:4251 )
static QAction* separator();
QAction* action( const int ) const;
int actionId( const QAction* ) const;
+
+ QList<QAction*> actions() const;
+ QList<int> actionIds() const;
+
int registerAction( const int, QAction* );
QAction* createAction( const int, const QString&, const QIcon&, const QString&,
- const QString&, const int, QObject* = 0,
+ const QString&, const QKeySequence&, QObject* = 0,
const bool = false, QObject* = 0, const char* = 0 );
protected slots: