: QObject(),
myApp( 0 ),
myName( name ),
- myDataModel( 0 )
+ myDataModel( 0 ),
+ myMenuShown( false ),
+ myToolShown( false )
{
}
ActionMgrLocker lock( toolMgr() );
- return toolMgr()->createToolBar( name );
+ return toolMgr()->createToolBar( name, myToolShown );
}
/*!
int regId = registerAction( id, a );
int intId = toolMgr()->insert( a, tBar, idx );
- setToolShown( a, false );
+ if ( !myToolShown )
+ setToolShown( a, false );
return intId != -1 ? regId : -1;
}
int regId = registerAction( id, a );
int intId = toolMgr()->insert( a, tBar, idx );
- setToolShown( a, false );
+ if ( !myToolShown )
+ setToolShown( a, false );
return intId != -1 ? regId : -1;
}
int intId = toolMgr()->insert( action( id ), tBar, idx );
- setToolShown( action( id ), false );
+ if ( !myToolShown )
+ setToolShown( action( id ), false );
return intId != -1 ? id : -1;
}
int intId = toolMgr()->insert( action( id ), tBar, idx );
- setToolShown( action( id ), false );
+ if ( !myToolShown )
+ setToolShown( action( id ), false );
return intId != -1 ? id : -1;
}
int regId = registerAction( id, a );
int intId = menuMgr()->insert( a, menu, group, idx );
- setMenuShown( a, false );
+ if ( !myMenuShown )
+ setMenuShown( a, false );
return intId != -1 ? regId : -1;
}
int regId = registerAction( id, a );
int intId = menuMgr()->insert( a, menu, group, idx );
- setMenuShown( a, false );
-
+ if ( !myMenuShown )
+ setMenuShown( a, false );
+
return intId != -1 ? regId : -1;
}
int intId = menuMgr()->insert( action( id ), menu, group, idx );
- setMenuShown( action( id ), false );
+ if ( !myMenuShown )
+ setMenuShown( action( id ), false );
return intId != -1 ? id : -1;
}
int intId = menuMgr()->insert( action( id ), menu, group, idx );
- setMenuShown( action( id ), false );
+ if ( !myMenuShown )
+ setMenuShown( action( id ), false );
return intId != -1 ? id : -1;
}
*/
void CAM_Module::setMenuShown( const bool on )
{
+ myMenuShown = on;
+
QtxActionMenuMgr* mMgr = menuMgr();
if ( !mMgr )
return;
*/
void CAM_Module::setToolShown( const bool on )
{
+ myToolShown = on;
+
QtxActionToolMgr* tMgr = toolMgr();
if ( !tMgr )
return;
\param title toolbar title
\param tid requested toolbar ID
\param mw parent main window; if it is null, the tool manager's main window is used
+ \param vis show toolbar visible immediately after creation (true by default)
\return id of created/found toolbar
*/
-int QtxActionToolMgr::createToolBar( const QString& title, const int tid, QMainWindow* mw )
+int QtxActionToolMgr::createToolBar( const QString& title, const int tid, QMainWindow* mw, bool vis )
{
- return createToolBar( title, true, Qt::AllToolBarAreas, tid, mw );
+ return createToolBar( title, true, Qt::AllToolBarAreas, tid, mw, vis );
}
+/*!
+ \brief Create toolbar and assign \a id to it.
+
+ If \a tid is less than 0, the identifier is generated automatically.
+ If toolbar with given \a tid is already registered, the toolbar will not be created.
+
+ \param title toolbar title
+ \param floatable if \c true, new toolbar is made floatable
+ \param dockAreas dock areas of the main window where the new toolbar can be situated
+ \param tid requested toolbar ID
+ \param mw parent main window; if it is null, the tool manager's main window is used
+ \param vis show toolbar visible immediately after creation (true by default)
+ \return id of created/found toolbar
+*/
int QtxActionToolMgr::createToolBar( const QString& title, bool floatable, Qt::ToolBarAreas dockAreas,
- int tid, QMainWindow* mw )
+ int tid, QMainWindow* mw, bool vis )
{
static int _toolBarId = -1;
tb->setWindowTitle( title );
tb->setObjectName( title );
tb->setToolTip( title );
- QApplication::postEvent( tb, new QHideEvent());
+ if ( !vis )
+ QApplication::postEvent( tb, new QHideEvent());
}
tInfo.toolBar = tb;
QMainWindow* mainWindow() const;
- int createToolBar( const QString&, int = -1, QMainWindow* = 0 );
+ int createToolBar( const QString&, int = -1, QMainWindow* = 0, bool = true );
int createToolBar( const QString&, bool, Qt::ToolBarAreas = Qt::AllToolBarAreas,
- int = -1, QMainWindow* = 0 );
+ int = -1, QMainWindow* = 0, bool = true );
void removeToolBar( const QString& );
void removeToolBar( const int );