From ebb50c1cc980913922357db0b01a98a4886720dd Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 16 Nov 2009 13:21:12 +0000 Subject: [PATCH] Issue 0020515: EDF 1114 GUI : When we store the position of windows, everything is not well restored --- src/GLViewer/GLViewer_ViewFrame.cxx | 2 +- src/OCCViewer/OCCViewer_ViewWindow.cxx | 2 +- src/Plot2d/Plot2d_ViewWindow.cxx | 2 +- src/Qtx/QtxActionToolMgr.cxx | 9 +++++++++ src/Qtx/QtxActionToolMgr.h | 2 ++ src/QxScene/QxScene_ViewWindow.cxx | 2 +- src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx | 1 + src/SVTK/SVTK_ViewWindow.cxx | 4 ++-- src/VTKViewer/VTKViewer_ViewWindow.cxx | 1 + 9 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/GLViewer/GLViewer_ViewFrame.cxx b/src/GLViewer/GLViewer_ViewFrame.cxx index b52bdb69f..4fa9bc876 100644 --- a/src/GLViewer/GLViewer_ViewFrame.cxx +++ b/src/GLViewer/GLViewer_ViewFrame.cxx @@ -153,7 +153,7 @@ void GLViewer_ViewFrame::createActions() */ void GLViewer_ViewFrame::createToolBar() { - int tid = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL") ); + int tid = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL"), false ); toolMgr()->append( DumpId, tid ); QtxMultiAction* aScaleAction = new QtxMultiAction( this ); diff --git a/src/OCCViewer/OCCViewer_ViewWindow.cxx b/src/OCCViewer/OCCViewer_ViewWindow.cxx index f7e311ff2..21b36661e 100755 --- a/src/OCCViewer/OCCViewer_ViewWindow.cxx +++ b/src/OCCViewer/OCCViewer_ViewWindow.cxx @@ -1102,7 +1102,7 @@ void OCCViewer_ViewWindow::createActions() */ void OCCViewer_ViewWindow::createToolBar() { - int tid = toolMgr()->createToolBar( tr( "LBL_TOOLBAR_LABEL" ) ); + int tid = toolMgr()->createToolBar( tr( "LBL_TOOLBAR_LABEL" ), false ); toolMgr()->append( DumpId, tid ); if( myModel->trihedronActivated() ) diff --git a/src/Plot2d/Plot2d_ViewWindow.cxx b/src/Plot2d/Plot2d_ViewWindow.cxx index 6fcdd2642..4f3dda2ca 100755 --- a/src/Plot2d/Plot2d_ViewWindow.cxx +++ b/src/Plot2d/Plot2d_ViewWindow.cxx @@ -386,7 +386,7 @@ void Plot2d_ViewWindow::createActions() void Plot2d_ViewWindow::createToolBar() { QtxActionToolMgr* mgr = toolMgr(); - myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ) ); + myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ), false ); mgr->append( DumpId, myToolBar ); mgr->append( ScaleOpId, myToolBar ); mgr->append( MoveOpId, myToolBar ); diff --git a/src/Qtx/QtxActionToolMgr.cxx b/src/Qtx/QtxActionToolMgr.cxx index 8f3b8804e..45a28aa04 100644 --- a/src/Qtx/QtxActionToolMgr.cxx +++ b/src/Qtx/QtxActionToolMgr.cxx @@ -99,6 +99,12 @@ QMainWindow* QtxActionToolMgr::mainWindow() const \return id of created/found toolbar */ int QtxActionToolMgr::createToolBar( const QString& title, const int tid, QMainWindow* mw ) +{ + return createToolBar( title, true, Qt::AllToolBarAreas, tid, mw ); +} + +int QtxActionToolMgr::createToolBar( const QString& title, bool floatable, Qt::ToolBarAreas dockAreas, + int tid, QMainWindow* mw ) { static int _toolBarId = -1; @@ -124,6 +130,9 @@ int QtxActionToolMgr::createToolBar( const QString& title, const int tid, QMainW if ( !tb ) { tb = new QtxToolBar( true, tbw ); + tb->setFloatable( floatable ); + tb->setAllowedAreas( dockAreas ); + tb->setMovable( dockAreas & Qt::AllToolBarAreas ); //mainWindow()->addToolBar( tb ); tb->setWindowTitle( title ); tb->setObjectName( title ); diff --git a/src/Qtx/QtxActionToolMgr.h b/src/Qtx/QtxActionToolMgr.h index dd6b19cf4..5f81e6e21 100644 --- a/src/Qtx/QtxActionToolMgr.h +++ b/src/Qtx/QtxActionToolMgr.h @@ -65,6 +65,8 @@ public: QMainWindow* mainWindow() const; int createToolBar( const QString&, int = -1, QMainWindow* = 0 ); + int createToolBar( const QString&, bool, Qt::ToolBarAreas = Qt::AllToolBarAreas, + int = -1, QMainWindow* = 0 ); void removeToolBar( const QString& ); void removeToolBar( const int ); diff --git a/src/QxScene/QxScene_ViewWindow.cxx b/src/QxScene/QxScene_ViewWindow.cxx index 0e1435cd8..28d7d71d4 100644 --- a/src/QxScene/QxScene_ViewWindow.cxx +++ b/src/QxScene/QxScene_ViewWindow.cxx @@ -161,7 +161,7 @@ void QxScene_ViewWindow::createToolBar() { DEBTRACE("QxScene_ViewWindow::createToolBar"); QtxActionToolMgr* mgr = toolMgr(); - myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ) ); + myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ), false ); mgr->append( ScaleOpId, myToolBar ); mgr->append( MoveOpId, myToolBar ); mgr->append( ResetId, myToolBar ); diff --git a/src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx b/src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx index 6cabb4e4e..2a08d294b 100755 --- a/src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx +++ b/src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx @@ -93,6 +93,7 @@ SUPERVGraph_ViewFrame::SUPERVGraph_ViewFrame( SUIT_Desktop* theDesktop ) setBackgroundColor(QColor(R,G,B));*/ myToolBar = new QToolBar(this); + myToolBar->setFloatable(false); //myToolBar->setCloseMode(QDockWindow::Undocked); myToolBar->setWindowTitle(tr("LBL_TOOLBAR_LABEL")); createActions(); diff --git a/src/SVTK/SVTK_ViewWindow.cxx b/src/SVTK/SVTK_ViewWindow.cxx index 7c834098b..8569a2e39 100755 --- a/src/SVTK/SVTK_ViewWindow.cxx +++ b/src/SVTK/SVTK_ViewWindow.cxx @@ -143,8 +143,8 @@ void SVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel) aRenderer->Delete(); aSelector->Delete(); - myToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL"), -1, this ); - myRecordingToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_RECORD_LABEL"), -1, this ); + myToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL"), false, Qt::AllToolBarAreas, -1, this ); + myRecordingToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_RECORD_LABEL"), false, Qt::AllToolBarAreas, -1, this ); createActions( SUIT_Session::session()->activeApplication()->resourceMgr() ); createToolBar(); diff --git a/src/VTKViewer/VTKViewer_ViewWindow.cxx b/src/VTKViewer/VTKViewer_ViewWindow.cxx index 454bb73a2..58238ca4a 100755 --- a/src/VTKViewer/VTKViewer_ViewWindow.cxx +++ b/src/VTKViewer/VTKViewer_ViewWindow.cxx @@ -92,6 +92,7 @@ VTKViewer_ViewWindow::VTKViewer_ViewWindow( SUIT_Desktop* theDesktop, setCentralWidget( myRenderWindow ); myToolBar = new QtxToolBar( true, tr("LBL_TOOLBAR_LABEL"), this ); + myToolBar->setFloatable( false ); createActions(); createToolBar(); -- 2.39.2