\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
\return id of created/found toolbar
*/
-int QtxActionToolMgr::createToolBar( const QString& title, const int tid )
+int QtxActionToolMgr::createToolBar( const QString& title, const int tid, QMainWindow* mw )
{
static int _toolBarId = -1;
if ( tbId != -1 )
return tbId;
- QToolBar* tb = find( title, mainWindow() );
+ QMainWindow* tbw = mw ? mw : mainWindow();
+ QToolBar* tb = find( title, tbw );
tbId = tid < 0 ? --_toolBarId : tid;
if ( !tb )
{
- tb = new QtxToolBar( true, mainWindow() );
+ tb = new QtxToolBar( true, tbw );
mainWindow()->addToolBar( tb );
tb->setWindowTitle( title );
tb->setObjectName( title );
QMainWindow* mainWindow() const;
- int createToolBar( const QString&, int = -1 );
+ int createToolBar( const QString&, int = -1, QMainWindow* = 0 );
void removeToolBar( const QString& );
void removeToolBar( const int );
virtual bool load( const QString&, QtxActionMgr::Reader& );
+ int find( QToolBar* ) const;
+
protected slots:
void onToolBarDestroyed();
protected:
- int find( QToolBar* ) const;
int find( const QString& ) const;
QToolBar* find( const QString&, QMainWindow* ) const;