]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Qt4 porting: automatic resizing of Hypothesis Construction: Number of Segments dialog.
authormkr <mkr@opencascade.com>
Mon, 31 Mar 2008 14:54:49 +0000 (14:54 +0000)
committermkr <mkr@opencascade.com>
Mon, 31 Mar 2008 14:54:49 +0000 (14:54 +0000)
src/SMESHGUI/SMESHGUI_Hypotheses.cxx
src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx
src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx

index adadbfb76cbf39b359f5578ead48150ace5323d5..7d2d2561cfce00fa740955b271507363962ddd1f 100644 (file)
@@ -152,7 +152,6 @@ bool SMESHGUI_GenericHypothesisCreator::editHypothesis( SMESH::SMESH_Hypothesis_
     Dlg->setObjectName( theHypName );
     Dlg->setHIcon( icon() );
     Dlg->setType( type() );
-    Dlg->setMinimumSize( Dlg->minimumSizeHint().width(), Dlg->minimumSizeHint().height() );
     retrieveParams();
     Dlg->show();
     if ( !myEventLoop )
index c3b5fb520eea8e9954a4af9416db34ddcac75176..a97afece4177c631182cc71ae8861b0ddda694a1 100644 (file)
@@ -48,6 +48,7 @@
 #include <QGridLayout>
 #include <QVBoxLayout>
 #include <QHBoxLayout>
+#include <QApplication>
 
 #define SPACING 6
 #define MARGIN  11
@@ -211,6 +212,9 @@ void StdMeshersGUI_NbSegmentsCreator::retrieveParams() const
   myTable->setFuncMinValue(myConv->checkedId()==0 ? -1E20 : 0);
   myTable->setData( data.myTable );
   myExpr->setText( data.myExpr );
+
+  if ( dlg() )
+    dlg()->setMinimumSize( dlg()->minimumSizeHint().width(), dlg()->minimumSizeHint().height() );
 }
 
 QString StdMeshersGUI_NbSegmentsCreator::storeParams() const
@@ -394,4 +398,11 @@ void StdMeshersGUI_NbSegmentsCreator::onValueChanged()
 
   if( isFunc )
     myPreview->setConversion( StdMeshersGUI_DistrPreview::Conversion( myConv->checkedId() ) );
+
+  if ( dlg() ) {
+    QApplication::instance()->processEvents();
+    dlg()->updateGeometry();
+    dlg()->setMinimumSize( dlg()->minimumSizeHint().width(), dlg()->minimumSizeHint().height() );
+    dlg()->resize( dlg()->minimumSize() );
+  }
 }
index 2daf8bd257ac0093cf0e9c596c1dcd22cf7dc693..2b78c23e12484c59695894fee2982b6ebc29cf65 100644 (file)
@@ -168,6 +168,9 @@ void StdMeshersGUI_StdHypothesisCreator::retrieveParams() const
     if ( widgetToActivate )
       widgetToActivate->activateSelection();
   }
+
+  if ( dlg() )
+    dlg()->setMinimumSize( dlg()->minimumSizeHint().width(), dlg()->minimumSizeHint().height() );
 }
 
 namespace {