From: ribes Date: Mon, 3 May 2010 14:43:12 +0000 (+0000) Subject: - Better management of QScrollArea X-Git-Tag: V5_1_4rc1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2f32eccea260aa56051fd108e5f490fae0a57172;p=modules%2Fjobmanager.git - Better management of QScrollArea - Now JOBMANAGER handle correctly low resolutions --- diff --git a/src/genericgui/BL_GenericGui.cxx b/src/genericgui/BL_GenericGui.cxx index f461516..fde75e3 100644 --- a/src/genericgui/BL_GenericGui.cxx +++ b/src/genericgui/BL_GenericGui.cxx @@ -40,6 +40,9 @@ BL::GenericGui::GenericGui(BL::MainWindows_Wrap * wrapper) : QObject(wrapper->ge // ---- Adding different GUI parts + + /* Tab Central Widget */ + /* Buttons */ _buttons = new BL::Buttons(_tab_parent); _buttons->setCreateButtonSlot(this, SLOT(create_job())); @@ -58,38 +61,41 @@ BL::GenericGui::GenericGui(BL::MainWindows_Wrap * wrapper) : QObject(wrapper->ge _job_tab = new BL::JobTab(_tab_parent, _jobs_manager); _job_tab->setModel(_model); - /* Tab Central Widget */ - //QWidget * central_widget = new QWidget(_tab_parent); - QScrollArea * central_widget = new QScrollArea(_tab_parent); - - QSplitter * tab_central_widget = new QSplitter(Qt::Vertical, central_widget); + // Central Widget + QWidget * central_widget = new QWidget(_tab_parent); + QSplitter * tab_central_widget = new QSplitter(Qt::Vertical, _tab_parent); tab_central_widget->addWidget(_jobs_table); tab_central_widget->addWidget(_job_tab); tab_central_widget->setChildrenCollapsible(false); - QVBoxLayout * central_layout = new QVBoxLayout; central_layout->addWidget(_buttons); central_layout->addWidget(tab_central_widget); central_widget->setLayout(central_layout); - _tab_parent->setCentralWidget(central_widget); - // Test tab - //QDockWidget * dw_main = new QDockWidget(_tab_parent); - //dw_main->setWidget(central_widget); - //_tab_parent->addDockWidget(Qt::LeftDockWidgetArea, dw_main); + // Adding a scroll area for low resolution + QScrollArea * scroll_central_widget = new QScrollArea(_tab_parent); + scroll_central_widget->setWidget(central_widget); + scroll_central_widget->setWidgetResizable(true); + _tab_parent->setCentralWidget(scroll_central_widget); /* Summary */ _dw_summary = new QDockWidget(_dock_parent); _dw_summary->setWindowTitle("Summary"); _summary = new BL::Summary(_dw_summary, _jobs_manager); _summary->setModel(_model); - _dw_summary->setWidget(_summary); + QScrollArea * scroll_widget_summary = new QScrollArea(_dw_summary); + scroll_widget_summary->setWidget(_summary); + scroll_widget_summary->setWidgetResizable(true); + _dw_summary->setWidget(scroll_widget_summary); /* ResourceCatalog */ _dw_resource_catalog = new QDockWidget(_dock_parent); _dw_resource_catalog->setWindowTitle("Resource Catalog"); _resource_catalog = new JM::ResourceCatalog(_dw_resource_catalog, _salome_services); - _dw_resource_catalog->setWidget(_resource_catalog); + QScrollArea * scroll_widget_resource = new QScrollArea(_dw_resource_catalog); + scroll_widget_resource->setWidget(_resource_catalog); + scroll_widget_resource->setWidgetResizable(true); + _dw_resource_catalog->setWidget(scroll_widget_resource); /* Main Dock Window */ _dock_parent->addDockWidget(Qt::RightDockWidgetArea, _jobs_manager); diff --git a/src/genericgui/BL_JobsManager_QT.cxx b/src/genericgui/BL_JobsManager_QT.cxx index d6ba047..fabacd7 100644 --- a/src/genericgui/BL_JobsManager_QT.cxx +++ b/src/genericgui/BL_JobsManager_QT.cxx @@ -42,7 +42,7 @@ BL::JobsManager_QT::JobsManager_QT(QWidget * parent, BL::GenericGui * main_gui, // Widget Part - QScrollArea * main_widget = new QScrollArea(this); + QWidget * main_widget = new QWidget(this); _load_jobs = new QPushButton("Load Jobs"); _save_jobs = new QPushButton("Save Jobs"); @@ -81,7 +81,10 @@ BL::JobsManager_QT::JobsManager_QT(QWidget * parent, BL::GenericGui * main_gui, mainLayout->addWidget(message_box); main_widget->setLayout(mainLayout); - setWidget(main_widget); + QScrollArea * scroll_widget = new QScrollArea(this); + scroll_widget->setWidget(main_widget); + scroll_widget->setWidgetResizable(true); + setWidget(scroll_widget); setWindowTitle("Job Manager"); } diff --git a/src/genericgui/BL_Summary.cxx b/src/genericgui/BL_Summary.cxx index c9062e4..ef79ee6 100644 --- a/src/genericgui/BL_Summary.cxx +++ b/src/genericgui/BL_Summary.cxx @@ -20,7 +20,7 @@ #include "BL_Summary.hxx" #include "BL_Traces.hxx" -BL::Summary::Summary(QWidget *parent, BL::JobsManager_QT * jobs_manager) : QScrollArea(parent) +BL::Summary::Summary(QWidget *parent, BL::JobsManager_QT * jobs_manager) : QWidget(parent) { DEBTRACE("Creating BL::Summary"); BL_ASSERT(parent); diff --git a/src/genericgui/BL_Summary.hxx b/src/genericgui/BL_Summary.hxx index 77ad509..8d45d27 100644 --- a/src/genericgui/BL_Summary.hxx +++ b/src/genericgui/BL_Summary.hxx @@ -25,7 +25,7 @@ namespace BL { - class Summary: public QScrollArea + class Summary: public QWidget { Q_OBJECT diff --git a/src/genericgui/JM_ResourceCatalog.cxx b/src/genericgui/JM_ResourceCatalog.cxx index 63b10f0..cebecff 100644 --- a/src/genericgui/JM_ResourceCatalog.cxx +++ b/src/genericgui/JM_ResourceCatalog.cxx @@ -22,7 +22,7 @@ #include "JM_SalomeResource.hxx" #include "JM_EditSalomeResource.hxx" -JM::ResourceCatalog::ResourceCatalog(QWidget *parent, BL::SALOMEServices * salome_services) : QScrollArea(parent) +JM::ResourceCatalog::ResourceCatalog(QWidget *parent, BL::SALOMEServices * salome_services) : QWidget(parent) { DEBTRACE("Creating JM::ResourceCatalog"); BL_ASSERT(parent); diff --git a/src/genericgui/JM_ResourceCatalog.hxx b/src/genericgui/JM_ResourceCatalog.hxx index 158b5b3..0c8e2b1 100644 --- a/src/genericgui/JM_ResourceCatalog.hxx +++ b/src/genericgui/JM_ResourceCatalog.hxx @@ -29,7 +29,7 @@ namespace JM { - class ResourceCatalog: public QScrollArea + class ResourceCatalog: public QWidget { Q_OBJECT