From: asl Date: Thu, 14 Feb 2008 12:59:11 +0000 (+0000) Subject: 1) the method find() is public now X-Git-Tag: V5_0_0a1~42 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c4a83ba75749a723f2d30688a2424d2cc6444c95;p=modules%2Fgui.git 1) the method find() is public now 2) the createToolBar() accepts the parameter QMainWindow* --- diff --git a/src/Qtx/QtxActionToolMgr.cxx b/src/Qtx/QtxActionToolMgr.cxx index 47b339edd..f234f2dcb 100644 --- a/src/Qtx/QtxActionToolMgr.cxx +++ b/src/Qtx/QtxActionToolMgr.cxx @@ -92,9 +92,10 @@ QMainWindow* QtxActionToolMgr::mainWindow() const \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; @@ -108,7 +109,8 @@ int QtxActionToolMgr::createToolBar( const QString& title, const int tid ) 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; @@ -117,7 +119,7 @@ int QtxActionToolMgr::createToolBar( const QString& title, const int tid ) if ( !tb ) { - tb = new QtxToolBar( true, mainWindow() ); + tb = new QtxToolBar( true, tbw ); mainWindow()->addToolBar( tb ); tb->setWindowTitle( title ); tb->setObjectName( title ); diff --git a/src/Qtx/QtxActionToolMgr.h b/src/Qtx/QtxActionToolMgr.h index be8bda268..b774dda33 100644 --- a/src/Qtx/QtxActionToolMgr.h +++ b/src/Qtx/QtxActionToolMgr.h @@ -61,7 +61,7 @@ public: 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 ); @@ -101,11 +101,12 @@ public: 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;