From: mkr Date: Mon, 31 Mar 2008 14:54:49 +0000 (+0000) Subject: Qt4 porting: automatic resizing of Hypothesis Construction: Number of Segments dialog. X-Git-Tag: V5_0_0~30 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=25db37c904d526979e171cc30528e49feea5af7c;p=modules%2Fsmesh.git Qt4 porting: automatic resizing of Hypothesis Construction: Number of Segments dialog. --- diff --git a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx index adadbfb76..7d2d2561c 100644 --- a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx +++ b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx @@ -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 ) diff --git a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx index c3b5fb520..a97afece4 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx @@ -48,6 +48,7 @@ #include #include #include +#include #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() ); + } } diff --git a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx index 2daf8bd25..2b78c23e1 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx @@ -168,6 +168,9 @@ void StdMeshersGUI_StdHypothesisCreator::retrieveParams() const if ( widgetToActivate ) widgetToActivate->activateSelection(); } + + if ( dlg() ) + dlg()->setMinimumSize( dlg()->minimumSizeHint().width(), dlg()->minimumSizeHint().height() ); } namespace {