From: asl Date: Mon, 28 Apr 2008 12:47:30 +0000 (+0000) Subject: fix for PAL19420: the toolbar should be found not only by name but also by correspond... X-Git-Tag: V5_0_0~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2983d733e39080015927090df558ba4eb0eec710;p=modules%2Fgui.git fix for PAL19420: the toolbar should be found not only by name but also by corresponding main window (except if main window is null) --- diff --git a/src/Qtx/QtxActionToolMgr.cxx b/src/Qtx/QtxActionToolMgr.cxx index e2c4b2048..84f285313 100644 --- a/src/Qtx/QtxActionToolMgr.cxx +++ b/src/Qtx/QtxActionToolMgr.cxx @@ -102,10 +102,9 @@ int QtxActionToolMgr::createToolBar( const QString& title, const int tid, QMainW int tbId = -1; for ( ToolBarMap::ConstIterator it = myToolBars.begin(); it != myToolBars.end() && tbId == -1; ++it ) { - // NKV - BUG IPAL19144 - search by toolbar title is done below via find() function - // if ( it.value().toolBar->windowTitle().toLower() == title.toLower() ) - // tbId = it.key(); - if (it.key() == tid) tbId = it.key(); + if( it.value().toolBar->windowTitle().toLower() == title.toLower() && + ( !mw || it.value().toolBar->parent()==mw ) ) + tbId = it.key(); } if ( tbId != -1 ) @@ -122,7 +121,7 @@ int QtxActionToolMgr::createToolBar( const QString& title, const int tid, QMainW if ( !tb ) { tb = new QtxToolBar( true, tbw ); - mainWindow()->addToolBar( tb ); + //mainWindow()->addToolBar( tb ); tb->setWindowTitle( title ); tb->setObjectName( title ); }