Provides support of menu/toolbars management.
*/
+class ActionMgrLocker
+{
+public:
+ ActionMgrLocker( QtxActionMgr* m ) : myMgr( m )
+ {
+ myUpdEnabled = myMgr->isUpdatesEnabled();
+ myMgr->setUpdatesEnabled( false );
+ }
+ ~ActionMgrLocker()
+ {
+ myMgr->setUpdatesEnabled( myUpdEnabled );
+ //myMgr->update();
+ }
+
+ QtxActionMgr* myMgr;
+ bool myUpdEnabled;
+};
+
/*!
\brief Default constructor.
if ( !toolMgr() )
return -1;
+ ActionMgrLocker lock( toolMgr() );
+
return toolMgr()->createToolBar( name );
}
if ( !toolMgr() )
return -1;
+ ActionMgrLocker lock( toolMgr() );
+
int regId = registerAction( id, a );
int intId = toolMgr()->insert( a, tBar, idx );
+
+ setToolShown( a, false );
+
return intId != -1 ? regId : -1;
}
if ( !toolMgr() )
return -1;
+ ActionMgrLocker lock( toolMgr() );
+
int regId = registerAction( id, a );
int intId = toolMgr()->insert( a, tBar, idx );
+
+ setToolShown( a, false );
+
return intId != -1 ? regId : -1;
}
if ( !toolMgr() )
return -1;
+ ActionMgrLocker lock( toolMgr() );
+
int intId = toolMgr()->insert( action( id ), tBar, idx );
+
+ setToolShown( action( id ), false );
+
return intId != -1 ? id : -1;
}
if ( !toolMgr() )
return -1;
+ ActionMgrLocker lock( toolMgr() );
+
int intId = toolMgr()->insert( action( id ), tBar, idx );
+
+ setToolShown( action( id ), false );
+
return intId != -1 ? id : -1;
}
{
if ( !menuMgr() )
return -1;
-
+
return menuMgr()->insert( subMenu, menu, group, id, idx );
}
{
if ( !a || !menuMgr() )
return -1;
+
+ ActionMgrLocker lock( menuMgr() );
int regId = registerAction( id, a );
int intId = menuMgr()->insert( a, menu, group, idx );
+
+ setMenuShown( a, false );
+
return intId != -1 ? regId : -1;
}
if ( !a || !menuMgr() )
return -1;
+ ActionMgrLocker lock( menuMgr() );
+
int regId = registerAction( id, a );
int intId = menuMgr()->insert( a, menu, group, idx );
+
+ setMenuShown( a, false );
+
return intId != -1 ? regId : -1;
}
if ( !menuMgr() )
return -1;
+ ActionMgrLocker lock( menuMgr() );
+
int intId = menuMgr()->insert( action( id ), menu, group, idx );
+
+ setMenuShown( action( id ), false );
+
return intId != -1 ? id : -1;
}
if ( !menuMgr() )
return -1;
+ ActionMgrLocker lock( menuMgr() );
+
int intId = menuMgr()->insert( action( id ), menu, group, idx );
+
+ setMenuShown( action( id ), false );
+
return intId != -1 ? id : -1;
}