]> SALOME platform Git repositories - modules/jobmanager.git/commitdiff
Salome HOME
- Better management of QScrollArea
authorribes <ribes>
Mon, 3 May 2010 14:43:12 +0000 (14:43 +0000)
committerribes <ribes>
Mon, 3 May 2010 14:43:12 +0000 (14:43 +0000)
- Now JOBMANAGER handle correctly low resolutions

src/genericgui/BL_GenericGui.cxx
src/genericgui/BL_JobsManager_QT.cxx
src/genericgui/BL_Summary.cxx
src/genericgui/BL_Summary.hxx
src/genericgui/JM_ResourceCatalog.cxx
src/genericgui/JM_ResourceCatalog.hxx

index f46151693f377ac1321a2a956eac59733b338229..fde75e34d95fc31d8fa637045c843c484d2af4e8 100644 (file)
@@ -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);
index d6ba047162d108f498be91e9f48247627b4270ba..fabacd77af6a63cadba550a73537150a8699fd04 100644 (file)
@@ -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");
 }
 
index c9062e420f0093061dbef30060ef9d435a1f32cf..ef79ee60049af5c854dce8a0581ad674e186ddba 100644 (file)
@@ -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);
index 77ad50944c580235895be0de626fc232a201d134..8d45d2733ea47f4f27d0eb52b2ce523e1912a5fd 100644 (file)
@@ -25,7 +25,7 @@
 
 namespace BL 
 {
-  class Summary: public QScrollArea
+  class Summary: public QWidget
   {
     Q_OBJECT
 
index 63b10f0287a7f90f9a49814f48449011fd333ae4..cebecffcabd2445fe5d5b72a34e711dfebab0292 100644 (file)
@@ -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);
index 158b5b3f8c42d0c3a2667ae813d35f69576eb559..0c8e2b1fb2112167f165708d90490e19bbea01a3 100644 (file)
@@ -29,7 +29,7 @@
 
 namespace JM 
 {
-  class ResourceCatalog: public QScrollArea
+  class ResourceCatalog: public QWidget
   {
     Q_OBJECT