Qt4 porting: automatic resizing of Hypothesis Construction: Number of Segments dialog.

This commit is contained in:
mkr 2008-03-31 14:54:49 +00:00
parent 4352a0e199
commit 25db37c904
3 changed files with 14 additions and 1 deletions

View File

@ -152,7 +152,6 @@ bool SMESHGUI_GenericHypothesisCreator::editHypothesis( SMESH::SMESH_Hypothesis_
Dlg->setObjectName( theHypName ); Dlg->setObjectName( theHypName );
Dlg->setHIcon( icon() ); Dlg->setHIcon( icon() );
Dlg->setType( type() ); Dlg->setType( type() );
Dlg->setMinimumSize( Dlg->minimumSizeHint().width(), Dlg->minimumSizeHint().height() );
retrieveParams(); retrieveParams();
Dlg->show(); Dlg->show();
if ( !myEventLoop ) if ( !myEventLoop )

View File

@ -48,6 +48,7 @@
#include <QGridLayout> #include <QGridLayout>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QApplication>
#define SPACING 6 #define SPACING 6
#define MARGIN 11 #define MARGIN 11
@ -211,6 +212,9 @@ void StdMeshersGUI_NbSegmentsCreator::retrieveParams() const
myTable->setFuncMinValue(myConv->checkedId()==0 ? -1E20 : 0); myTable->setFuncMinValue(myConv->checkedId()==0 ? -1E20 : 0);
myTable->setData( data.myTable ); myTable->setData( data.myTable );
myExpr->setText( data.myExpr ); myExpr->setText( data.myExpr );
if ( dlg() )
dlg()->setMinimumSize( dlg()->minimumSizeHint().width(), dlg()->minimumSizeHint().height() );
} }
QString StdMeshersGUI_NbSegmentsCreator::storeParams() const QString StdMeshersGUI_NbSegmentsCreator::storeParams() const
@ -394,4 +398,11 @@ void StdMeshersGUI_NbSegmentsCreator::onValueChanged()
if( isFunc ) if( isFunc )
myPreview->setConversion( StdMeshersGUI_DistrPreview::Conversion( myConv->checkedId() ) ); 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() );
}
} }

View File

@ -168,6 +168,9 @@ void StdMeshersGUI_StdHypothesisCreator::retrieveParams() const
if ( widgetToActivate ) if ( widgetToActivate )
widgetToActivate->activateSelection(); widgetToActivate->activateSelection();
} }
if ( dlg() )
dlg()->setMinimumSize( dlg()->minimumSizeHint().width(), dlg()->minimumSizeHint().height() );
} }
namespace { namespace {