]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/ParametersQtDialog.cxx
...
[cpPlugins.git] / lib / cpPlugins / ParametersQtDialog.cxx
index 09e30feaf706944552e9a7de16b9c4a4de1f7b50..38733d5b08a40c30c7f53f635d777d08283a379d 100644 (file)
 
 // -------------------------------------------------------------------------
 cpPlugins::ParametersQtDialog::
-ParametersQtDialog( QWidget* parent, Qt::WindowFlags f )
+ParametersQtDialog( QWidget* parent, Qt::WindowFlags f, bool manual )
   : QDialog( parent, f ),
     m_ProcessObject( NULL ),
-    m_WidgetsUpdated( false )
+    m_WidgetsUpdated( false ),
+    m_Manual( manual )
 {
-  this->m_Title = new QLabel( this );
-  this->m_Title->setText( "Parameters dialog title" );
+  if( !this->m_Manual )
+  {
+    this->m_Title = new QLabel( this );
+    this->m_Title->setText( "Parameters dialog title" );
+    this->m_MainLayout = new QGridLayout( this );
+    this->m_ToolsLayout = new QVBoxLayout( );
+    this->m_ToolsLayout->addWidget( this->m_Title );
+    this->m_MainLayout->addLayout( this->m_ToolsLayout, 0, 0, 1, 1 );
 
-  this->m_MainLayout = new QGridLayout( this );
-  this->m_ToolsLayout = new QVBoxLayout( );
-  this->m_ToolsLayout->addWidget( this->m_Title );
-  this->m_MainLayout->addLayout( this->m_ToolsLayout, 0, 0, 1, 1 );
+  } // fi
 }
 
 // -------------------------------------------------------------------------
 cpPlugins::ParametersQtDialog::
 ~ParametersQtDialog( )
 {
-  delete this->m_Title;
-  delete this->m_ToolsLayout;
-  delete this->m_MainLayout;
+  if( !this->m_Manual )
+  {
+    delete this->m_Title;
+    delete this->m_ToolsLayout;
+    delete this->m_MainLayout;
+
+  } // fi
 }
 
 // -------------------------------------------------------------------------
@@ -81,6 +89,8 @@ updateParameters( )
 {
   if( this->m_ProcessObject == NULL )
     return;
+  if( this->m_Manual )
+    return;
 
   // Put values
   auto parameters = this->m_ProcessObject->GetParameters( );
@@ -173,6 +183,8 @@ updateView( )
 {
   if( this->m_ProcessObject == NULL )
     return;
+  if( this->m_Manual )
+    return;
 
   // Put values
   auto parameters = this->m_ProcessObject->GetParameters( );
@@ -275,6 +287,9 @@ updateView( )
 void cpPlugins::ParametersQtDialog::
 _addButtons( )
 {
+  if( this->m_Manual )
+    return;
+
   // Add buttons
   this->m_Buttons = new QDialogButtonBox(
     QDialogButtonBox::Ok | QDialogButtonBox::Cancel
@@ -297,6 +312,8 @@ _updateWidgets( )
 {
   if( this->m_WidgetsUpdated || this->m_ProcessObject == NULL )
     return;
+  if( !this->m_Manual )
+    return;
 
   // Set dialog title
   std::stringstream title;