]> SALOME platform Git repositories - modules/multipr.git/blobdiff - src/MULTIPRGUI/MULTIPR_GUI_Dlg.cxx
Salome HOME
Porting to Qt4 and autotools
[modules/multipr.git] / src / MULTIPRGUI / MULTIPR_GUI_Dlg.cxx
index 1549a4df3415619a8814cc5763d536a49ef17560..0f53ce08a675aada79e87108fb76b40afd348873 100644 (file)
 #include <SALOME_LifeCycleCORBA.hxx>
 
 // QT Includes
-#include <qapplication.h>
-#include <qinputdialog.h>
-#include <qlayout.h>
-#include <qpushbutton.h>
-#include <qgroupbox.h>
-#include <qvbox.h>
-#include <qbuttongroup.h>
-#include <qlabel.h>
-#include <qcombobox.h>
-#include <qvariant.h>
-#include <qlineedit.h>
-#include <qspinbox.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
-#include <qimage.h>
-#include <qpixmap.h>
+#include <QApplication>
+#include <QInputDialog>
+#include <QLayout>
+#include <QPushButton>
+#include <QGroupBox>
+#include <QVBoxLayout>
+#include <QLabel>
+#include <QComboBox>
+#include <QVariant>
+#include <QLineEdit>
+#include <QSpinBox>
+#include <QWhatsThis>
+#include <QImage>
+#include <QPixmap>
 
 // MED include
 extern "C"
@@ -54,50 +52,47 @@ extern "C"
 
 using namespace std;
 
-
 MULTIPR_GUI_Partition1Dlg::MULTIPR_GUI_Partition1Dlg(MULTIPR_GUI* theModule) : 
     QDialog(
-        theModule->application()->desktop(), 
-        0, 
-        false, 
-        WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+        (QWidget*)theModule->application()->desktop(), 
+        Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
 {
     mModule = theModule;
     
-    buttonGroupProcess = new QButtonGroup( this, "buttonGroupProcess" );
-    buttonGroupProcess->setGeometry( QRect( 10, 110, 450, 60 ) );
+    groupBoxProcess = new QGroupBox( "groupBoxProcess",this );
+    groupBoxProcess->setGeometry( QRect( 10, 110, 450, 60 ) );
 
-    pushButtonOK = new QPushButton( buttonGroupProcess, "pushButtonOK" );
+    pushButtonOK = new QPushButton( QString("pushButtonOK"),groupBoxProcess );
     pushButtonOK->setGeometry( QRect( 10, 10, 110, 41 ) );
     
-    pushButtonCancel = new QPushButton( buttonGroupProcess, "pushButtonCancel" );
+    pushButtonCancel = new QPushButton( QString("pushButtonCancel"),groupBoxProcess );
     pushButtonCancel->setGeometry( QRect( 321, 10, 110, 41 ) );
 
-    buttonGroupSelectMesh = new QButtonGroup( this, "buttonGroupSelectMesh" );
-    buttonGroupSelectMesh->setGeometry( QRect( 10, 10, 450, 91 ) );
+    groupBoxSelectMesh = new QGroupBox( "groupBoxSelectMesh",this );
+    groupBoxSelectMesh->setGeometry( QRect( 10, 10, 450, 91 ) );
 
-    comboBoxSelectMesh = new QComboBox( FALSE, buttonGroupSelectMesh, "comboBoxSelectMesh" );
+    comboBoxSelectMesh = new QComboBox( groupBoxSelectMesh );
     comboBoxSelectMesh->setGeometry( QRect( 160, 30, 280, 40 ) );
     MULTIPR_ORB::string_array* listMeshes = theModule->getMULTIPRObj()->getMeshes();
     for (int i=0; i<listMeshes->length() ; i++)
     {
         const char* strItem = (*listMeshes)[i];
-        comboBoxSelectMesh->insertItem(strItem);
+        comboBoxSelectMesh->insertItem(0,strItem);
     }
     comboBoxSelectMesh->setEditable(false);
 
-    textLabelSelectMesh = new QLabel( buttonGroupSelectMesh, "textLabelSelectMesh" );
+    textLabelSelectMesh = new QLabel( "textLabelSelectMesh",groupBoxSelectMesh );
     textLabelSelectMesh->setGeometry( QRect( 20, 30, 110, 40 ) );
     
-    setCaption( tr( "Extract groups from sequential MED file" ) );
-    buttonGroupProcess->setTitle( QString::null );
+    setWindowTitle( tr( "Extract groups from sequential MED file" ) );
+    groupBoxProcess->setTitle( QString::null );
     pushButtonCancel->setText( tr( "Cancel" ) );
     pushButtonOK->setText( tr("OK") );
-    buttonGroupSelectMesh->setTitle( tr( "Select mesh" ) );
+    groupBoxSelectMesh->setTitle( tr( "Select mesh" ) );
     textLabelSelectMesh->setText( tr( "Mesh name" ) );
     
     resize( QSize(471, 185).expandedTo(minimumSizeHint()) );
-    clearWState( WState_Polished );
+    //clearWState( WState_Polished );
     
     connect(pushButtonOK,     SIGNAL(clicked()), this, SLOT(accept()));
     connect(pushButtonCancel, SIGNAL(clicked()), this, SLOT(reject()));
@@ -115,24 +110,23 @@ MULTIPR_GUI_Partition1Dlg::~MULTIPR_GUI_Partition1Dlg()
 
 void MULTIPR_GUI_Partition1Dlg::accept()
 {
-    const char* meshName = comboBoxSelectMesh->currentText().latin1();
+    const char* meshName = comboBoxSelectMesh->currentText().toLatin1();
     
     try
     {
         mModule->getMULTIPRObj()->setMesh(meshName);
         
-        QApplication::setOverrideCursor(Qt::waitCursor);
+        QApplication::setOverrideCursor(Qt::WaitCursor);
         mModule->getMULTIPRObj()->partitionneDomaine();
         QApplication::restoreOverrideCursor();
         
     }
     catch(...)
     {
-        SUIT_MessageBox::error1( 
-            mModule->getAppli()->desktop(),
-            "Import MED file error", 
-            "Unable to set mesh", 
-            tr("OK") );
+        SUIT_MessageBox::critical( 
+            (QWidget*)mModule->getAppli()->desktop(),
+            QString("Import MED file error"), 
+            QString("Unable to set mesh"));
     }
 
     QDialog::accept();
@@ -147,53 +141,51 @@ void MULTIPR_GUI_Partition1Dlg::reject()
 
 MULTIPR_GUI_Partition2Dlg::MULTIPR_GUI_Partition2Dlg(MULTIPR_GUI* theModule) : 
     QDialog(
-        theModule->application()->desktop(), 
-        0, 
-        false, 
-        WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+        (QWidget*)theModule->application()->desktop(), 
+        Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
 {
     mModule = theModule;
     
-    buttonGroupSplitParameters = new QButtonGroup( this, "buttonGroupSplitParameters" );
-    buttonGroupSplitParameters->setGeometry( QRect( 10, 10, 380, 140 ) );
+    groupBoxSplitParameters = new QGroupBox( "groupBoxSplitParameters",this );
+    groupBoxSplitParameters->setGeometry( QRect( 10, 10, 380, 140 ) );
 
-    textLabelSelectNbParts = new QLabel( buttonGroupSplitParameters, "textLabelSelectNbParts" );
+    textLabelSelectNbParts = new QLabel( "textLabelSelectNbParts",groupBoxSplitParameters );
     textLabelSelectNbParts->setGeometry( QRect( 30, 30, 160, 31 ) );
 
-    textLabelSelectSplitter = new QLabel( buttonGroupSplitParameters, "textLabelSelectSplitter" );
+    textLabelSelectSplitter = new QLabel( "textLabelSelectSplitter",groupBoxSplitParameters );
     textLabelSelectSplitter->setGeometry( QRect( 30, 80, 111, 31 ) );
 
-    comboBoxSelectSplitter = new QComboBox( FALSE, buttonGroupSplitParameters, "comboBoxSelectSplitter" );
+    comboBoxSelectSplitter = new QComboBox(groupBoxSplitParameters);
     comboBoxSelectSplitter->setGeometry( QRect( 210, 80, 150, 40 ) );
-    comboBoxSelectSplitter->insertItem("METIS");
-    comboBoxSelectSplitter->insertItem("SCOTCH");
+    comboBoxSelectSplitter->insertItem(0,"METIS");
+    comboBoxSelectSplitter->insertItem(0,"SCOTCH");
     comboBoxSelectSplitter->setEditable(false);
 
-    spinBoxNbParts = new QSpinBox( buttonGroupSplitParameters, "spinBoxNbParts" );
+    spinBoxNbParts = new QSpinBox( groupBoxSplitParameters);
     spinBoxNbParts->setGeometry( QRect( 210, 30, 150, 30 ) );
-    spinBoxNbParts->setMaxValue( 1000 );
-    spinBoxNbParts->setMinValue( 2 );
+    spinBoxNbParts->setMaximum( 1000 );
+    spinBoxNbParts->setMinimum( 2 );
     spinBoxNbParts->setValue( 2 );
 
-    buttonGroupProcess = new QButtonGroup( this, "buttonGroupProcess" );
-    buttonGroupProcess->setGeometry( QRect( 10, 160, 380, 60 ) );
+    groupBoxProcess = new QGroupBox( "groupBoxProcess",this );
+    groupBoxProcess->setGeometry( QRect( 10, 160, 380, 60 ) );
 
-    pushButtonOK = new QPushButton( buttonGroupProcess, "pushButtonOK" );
+    pushButtonOK = new QPushButton( QString("pushButtonOK"),groupBoxProcess );
     pushButtonOK->setGeometry( QRect( 10, 10, 110, 41 ) );
 
-    pushButtonCancel = new QPushButton( buttonGroupProcess, "pushButtonCancel" );
+    pushButtonCancel = new QPushButton( QString("pushButtonCancel"),groupBoxProcess );
     pushButtonCancel->setGeometry( QRect( 250, 10, 110, 41 ) );
     
-    setCaption( tr( "Split selected part" ) );
-    buttonGroupSplitParameters->setTitle( tr( "Split parameters" ) );
+    setWindowTitle( tr( "Split selected part" ) );
+    groupBoxSplitParameters->setTitle( tr( "Split parameters" ) );
     textLabelSelectNbParts->setText( tr( "Number of sub-parts" ) );
     textLabelSelectSplitter->setText( tr( "Splitter" ) );
-    buttonGroupProcess->setTitle( QString::null );
+    groupBoxProcess->setTitle( QString::null );
     pushButtonOK->setText( tr("OK") );
     pushButtonCancel->setText( tr( "Cancel" ) );
     
     resize( QSize(403, 234).expandedTo(minimumSizeHint()) );
-    clearWState( WState_Polished );
+    //clearWState( WState_Polished );
     
     connect(pushButtonOK,     SIGNAL(clicked()), this, SLOT(accept()));
     connect(pushButtonCancel, SIGNAL(clicked()), this, SLOT(reject()));
@@ -211,7 +203,7 @@ MULTIPR_GUI_Partition2Dlg::~MULTIPR_GUI_Partition2Dlg()
 
 void MULTIPR_GUI_Partition2Dlg::accept()
 {
-    const char* strSplitter = comboBoxSelectSplitter->currentText().latin1();
+    const char* strSplitter = comboBoxSelectSplitter->currentText().toLatin1();
     int nbParts = spinBoxNbParts->value();
     int partitionner = -1;
     if (strcmp(strSplitter, "METIS") == 0)
@@ -223,7 +215,7 @@ void MULTIPR_GUI_Partition2Dlg::accept()
         partitionner = 1;
     }
     
-    QApplication::setOverrideCursor(Qt::waitCursor);
+    QApplication::setOverrideCursor(Qt::WaitCursor);
     
     try
     {
@@ -231,18 +223,17 @@ void MULTIPR_GUI_Partition2Dlg::accept()
         for (QStringList::const_iterator it = partsList.begin(), last = partsList.end(); it != last; it++)
         {
             const QString& partName = (*it);
-            //cout << "Split " << partName.latin1() << " #parts=" << nbParts << " splitter=" << strSplitter << endl;
-            mModule->getMULTIPRObj()->partitionneGroupe(partName.latin1(), nbParts, partitionner);
+            //cout << "Split " << partName.toLatin1() << " #parts=" << nbParts << " splitter=" << strSplitter << endl;
+            mModule->getMULTIPRObj()->partitionneGroupe(partName.toLatin1(), nbParts, partitionner);
         }
         
     }
     catch(...)
     {
-        SUIT_MessageBox::error1
-            mModule->getAppli()->desktop(),
+        SUIT_MessageBox::critical
+            (QWidget*)mModule->getAppli()->desktop(),
             "Split error", 
-            "Error while splitting selected part(s)", 
-            tr("OK") );
+            "Error while splitting selected part(s)"); 
     }
     
     QApplication::restoreOverrideCursor();
@@ -258,25 +249,23 @@ void MULTIPR_GUI_Partition2Dlg::reject()
 
 MULTIPR_GUI_DecimateDlg::MULTIPR_GUI_DecimateDlg(MULTIPR_GUI* theModule) :
     QDialog(
-    theModule->application()->desktop(), 
-        0, 
-        false, 
-        WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+    (QWidget*)theModule->application()->desktop(), 
+        Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
 {
     mModule = theModule;
-    buttonGroupSelectField = new QButtonGroup( this, "buttonGroupSelectField" );
-    buttonGroupSelectField->setGeometry( QRect( 10, 10, 710, 140 ) );
+    groupBoxSelectField = new QGroupBox("groupBoxSelectField",this );
+    groupBoxSelectField->setGeometry( QRect( 10, 10, 710, 140 ) );
 
-    textLabelSelectFieldName = new QLabel( buttonGroupSelectField, "textLabelSelectFieldName" );
+    textLabelSelectFieldName = new QLabel( "textLabelSelectFieldName",groupBoxSelectField );
     textLabelSelectFieldName->setGeometry( QRect( 30, 30, 141, 31 ) );
 
-    textLabelSelectFieldIteration = new QLabel( buttonGroupSelectField, "textLabelSelectFieldIteration" );
+    textLabelSelectFieldIteration = new QLabel( "textLabelSelectFieldIteration",groupBoxSelectField );
     textLabelSelectFieldIteration->setGeometry( QRect( 30, 80, 111, 31 ) );
 
     const QStringList& partsList = mModule->getSelectedParts();
     // Lets get the fields !.
     QString allParts = partsList.join("|");
-    MULTIPR_ORB::string_array* listFields = theModule->getMULTIPRObj()->getFields(allParts.latin1());
+    MULTIPR_ORB::string_array* listFields = theModule->getMULTIPRObj()->getFields(allParts.toLatin1());
     int maxIteration = 0;
     int i, j;
     for (i = 0 ; i < listFields->length() ; ++i)
@@ -284,7 +273,7 @@ MULTIPR_GUI_DecimateDlg::MULTIPR_GUI_DecimateDlg(MULTIPR_GUI* theModule) :
         char* strItem = (*listFields)[i];
         for (j = 0; strItem[j] && strItem[j] != ' '; ++j);
         strItem[j] = 0;
-        CORBA::Long nbIteration = theModule->getMULTIPRObj()->getTimeStamps(allParts.latin1(), strItem);
+        CORBA::Long nbIteration = theModule->getMULTIPRObj()->getTimeStamps(allParts.toLatin1(), strItem);
         strItem[j] = ' ';
         if (nbIteration > maxIteration) 
         {
@@ -292,66 +281,66 @@ MULTIPR_GUI_DecimateDlg::MULTIPR_GUI_DecimateDlg(MULTIPR_GUI* theModule) :
         }
     }
 
-    comboBoxSelectFieldIteration = new QComboBox( FALSE, buttonGroupSelectField, "comboBoxSelectFieldIteration" );
+    comboBoxSelectFieldIteration = new QComboBox( groupBoxSelectField );
     comboBoxSelectFieldIteration->setGeometry( QRect( 150, 80, 540, 40 ) );
     for (int i=1 ; i<=maxIteration ; i++)
     {
-        comboBoxSelectFieldIteration->insertItem(QString::number(i));
+        comboBoxSelectFieldIteration->insertItem(0,QString::number(i));
     }
 
-    comboBoxSelectFieldName = new QComboBox( FALSE, buttonGroupSelectField, "comboBoxSelectFieldName" );
+    comboBoxSelectFieldName = new QComboBox(groupBoxSelectField );
     comboBoxSelectFieldName->setGeometry( QRect( 150, 30, 540, 40 ) );
     for (int i=0 ; i<listFields->length() ; i++)
     {
         const char* strItem = (*listFields)[i];
-        comboBoxSelectFieldName->insertItem(strItem);
+        comboBoxSelectFieldName->insertItem(0,strItem);
     }
     comboBoxSelectFieldName->setEditable(false);
-    QToolTip::add( comboBoxSelectFieldName, tr( "only scalar fields are listed (multi-component fields are not displayed)" ) );
+    comboBoxSelectFieldName->setToolTip(tr( "only scalar fields are listed (multi-component fields are not displayed)" ));
 
-    buttonGroupSelectFilter = new QButtonGroup( this, "buttonGroupSelectFilter" );
-    buttonGroupSelectFilter->setGeometry( QRect( 10, 160, 710, 90 ) );
+    groupBoxSelectFilter = new QGroupBox("groupBoxSelectFilter",this );
+    groupBoxSelectFilter->setGeometry( QRect( 10, 160, 710, 90 ) );
 
-    textLabelSelectFilter = new QLabel( buttonGroupSelectFilter, "textLabelSelectFilter" );
+    textLabelSelectFilter = new QLabel( "textLabelSelectFilter",groupBoxSelectFilter );
     textLabelSelectFilter->setGeometry( QRect( 30, 30, 101, 31 ) );
 
-    comboBoxSelectFilter = new QComboBox( FALSE, buttonGroupSelectFilter, "comboBoxSelectFilter" );
+    comboBoxSelectFilter = new QComboBox( groupBoxSelectFilter );
     comboBoxSelectFilter->setGeometry( QRect( 150, 30, 540, 40 ) );
-    comboBoxSelectFilter->insertItem("Filtre_GradientMoyen");
-       comboBoxSelectFilter->insertItem("Filtre_Direct");
+    comboBoxSelectFilter->insertItem(0,"Filtre_GradientMoyen");
+    comboBoxSelectFilter->insertItem(0,"Filtre_Direct");
 
-    buttonGroupParameters = new QButtonGroup( this, "buttonGroupParameters" );
-    buttonGroupParameters->setGeometry( QRect( 10, 260, 710, 210 ) );
+    groupBoxParameters = new QGroupBox( "groupBoxParameters" ,this);
+    groupBoxParameters->setGeometry( QRect( 10, 260, 710, 210 ) );
 
-    textLabelTMed = new QLabel( buttonGroupParameters, "textLabelTMed" );
+    textLabelTMed = new QLabel( "textLabelTMed",groupBoxParameters );
     textLabelTMed->setGeometry( QRect( 20, 40, 242, 30 ) );
 
-    textLabelTLow = new QLabel( buttonGroupParameters, "textLabelTLow" );
+    textLabelTLow = new QLabel( "textLabelTLow",groupBoxParameters );
     textLabelTLow->setGeometry( QRect( 20, 80, 208, 30 ) );
 
-    textLabelRadius = new QLabel( buttonGroupParameters, "textLabelRadius" );
+    textLabelRadius = new QLabel( "textLabelRadius",groupBoxParameters );
     textLabelRadius->setGeometry( QRect( 20, 120, 211, 30 ) );
 
-    textLabelBoxing = new QLabel( buttonGroupParameters, "textLabelBoxing" );
+    textLabelBoxing = new QLabel( "textLabelBoxing",groupBoxParameters );
     textLabelBoxing->setGeometry( QRect( 20, 160, 241, 30 ) );
 
-    lineEditTMed = new QLineEdit( buttonGroupParameters, "lineEditTMed" );
+    lineEditTMed = new QLineEdit( groupBoxParameters );
     lineEditTMed->setGeometry( QRect( 580, 40, 111, 30 ) );
 
-    lineEditTLow = new QLineEdit( buttonGroupParameters, "lineEditTLow" );
+    lineEditTLow = new QLineEdit( groupBoxParameters );
     lineEditTLow->setGeometry( QRect( 580, 80, 111, 30 ) );
 
-    lineEditRadius = new QLineEdit( buttonGroupParameters, "lineEditRadius" );
+    lineEditRadius = new QLineEdit( groupBoxParameters );
     lineEditRadius->setGeometry( QRect( 580, 120, 111, 30 ) );
 
-    spinBoxBoxing = new QSpinBox( buttonGroupParameters, "spinBoxBoxing" );
+    spinBoxBoxing = new QSpinBox( groupBoxParameters );
     spinBoxBoxing->setGeometry( QRect( 580, 160, 111, 30 ) );
-    spinBoxBoxing->setMaxValue( 200 );
-    spinBoxBoxing->setMinValue( 2 );
+    spinBoxBoxing->setMaximum( 200 );
+    spinBoxBoxing->setMinimum( 2 );
     spinBoxBoxing->setValue( 100 );
-    QToolTip::add( spinBoxBoxing, tr( "grid: number of cells along each axis" ) );
+    spinBoxBoxing->setToolTip(tr( "grid: number of cells along each axis" ) );
 
-       infoGroup = new QButtonGroup(this, "infoGroup");
+       infoGroup = new QGroupBox("infoGroup",this);
        infoGroup->setGeometry( QRect( 10, 480, 710, 60 ) );
 
        char* stats;
@@ -361,38 +350,38 @@ MULTIPR_GUI_DecimateDlg::MULTIPR_GUI_DecimateDlg(MULTIPR_GUI* theModule) :
     for (QStringList::const_iterator it = partsList.begin(), last = partsList.end(); it != last; it++)
     {
                const QString& partName = (*it);
-               stats = theModule->getMULTIPRObj()->getMEDInfo(partName.latin1());
+               stats = theModule->getMULTIPRObj()->getMEDInfo(partName.toLatin1());
                sscanf(stats, "%d", &tmp);
                acum += tmp;
     }
        
        char buf[512];
        sprintf(buf, "%d", acum);
-       textLabelInfo = new QLabel( infoGroup, "textLabelInfo");
+       textLabelInfo = new QLabel( "textLabelInfo",infoGroup);
        textLabelInfo->setText("Number of cells:");
     textLabelInfo->setGeometry( QRect( 20, 10, 242, 30 ) );    
-       textLabelInfoValue = new QLabel( infoGroup, "textLabelInfoValue");
-       textLabelInfoValue->setAlignment(AlignRight);
+       textLabelInfoValue = new QLabel( "textLabelInfoValue",infoGroup);
+       textLabelInfoValue->setAlignment(Qt::AlignRight);
        textLabelInfoValue->setText(buf);
     textLabelInfoValue->setGeometry( QRect( 400, 10, 290, 30 ) );      
                        
-    buttonGroupProcess = new QButtonGroup( this, "buttonGroupProcess" );
-    buttonGroupProcess->setGeometry( QRect( 10, 580, 710, 60 ) );
+    groupBoxProcess = new QGroupBox("groupBoxProcess",this );
+    groupBoxProcess->setGeometry( QRect( 10, 580, 710, 60 ) );
 
-    pushButtonOK = new QPushButton( buttonGroupProcess, "pushButtonOK" );
+    pushButtonOK = new QPushButton( QString( "pushButtonOK"),groupBoxProcess );
     pushButtonOK->setGeometry( QRect( 10, 10, 110, 41 ) );
     
-    pushButtonCancel = new QPushButton( buttonGroupProcess, "pushButtonCancel" );
+    pushButtonCancel = new QPushButton( QString("pushButtonCancel"),groupBoxProcess );
     pushButtonCancel->setGeometry( QRect( 581, 10, 110, 41 ) );
-    pushButtonCancel->setAccel( QKeySequence( tr( "Esc" ) ) );
+    pushButtonCancel->setShortcut( QKeySequence( tr( "Esc" ) ) );
     
-    setCaption( tr( "Decimation" ) );
-    buttonGroupSelectField->setTitle( tr( "Select field" ) );
+    setWindowTitle( tr( "Decimation" ) );
+    groupBoxSelectField->setTitle( tr( "Select field" ) );
     textLabelSelectFieldName->setText( tr( "Field name" ) );
     textLabelSelectFieldIteration->setText( tr( "Field iteration" ) );
-    buttonGroupSelectFilter->setTitle( tr( "Select filter" ) );
+    groupBoxSelectFilter->setTitle( tr( "Select filter" ) );
     textLabelSelectFilter->setText( tr( "Filter name" ) );
-    buttonGroupParameters->setTitle( tr( "Set parameters" ) );
+    groupBoxParameters->setTitle( tr( "Set parameters" ) );
     textLabelTMed->setText( tr( "Threshold for medium resolution" ) );
     textLabelTLow->setText( tr( "Threshold for low resolution" ) );
     textLabelRadius->setText( tr( "Radius (neighborhood)" ) );
@@ -402,28 +391,28 @@ MULTIPR_GUI_DecimateDlg::MULTIPR_GUI_DecimateDlg(MULTIPR_GUI* theModule) :
 
     float defaultRadius = 0.5f;
     lineEditRadius->setText( QString::number(defaultRadius) );
-    buttonGroupProcess->setTitle( QString::null );
+    groupBoxProcess->setTitle( QString::null );
     pushButtonCancel->setText( tr( "Cancel" ) );
     pushButtonOK->setText( tr("OK") );
     
-    pushButtonThresholdAuto = new QPushButton( buttonGroupParameters, "pushButtonThresholdAuto" );
+    pushButtonThresholdAuto = new QPushButton( QString("pushButtonThresholdAuto"),groupBoxParameters );
     pushButtonThresholdAuto->setGeometry( QRect( 520, 80, 50, 30 ) );
     QFont pushButtonThresholdAuto_font(  pushButtonThresholdAuto->font() );
     pushButtonThresholdAuto_font.setPointSize( 11 );
     pushButtonThresholdAuto->setFont( pushButtonThresholdAuto_font ); 
     pushButtonThresholdAuto->setText( tr( "auto" ) );
-    QToolTip::add( pushButtonThresholdAuto, tr( "compute extremum for gradient (set medium=MIN and low=MAX)" ) );
+    pushButtonThresholdAuto->setToolTip(tr( "compute extremum for gradient (set medium=MIN and low=MAX)" ) );
 
-    pushButtonRadiusAuto = new QPushButton( buttonGroupParameters, "pushButtonRadiusAuto" );
+    pushButtonRadiusAuto = new QPushButton( QString("pushButtonRadiusAuto"),groupBoxParameters );
     pushButtonRadiusAuto->setGeometry( QRect( 520, 120, 50, 30 ) );
     QFont pushButtonRadiusAuto_font(  pushButtonRadiusAuto->font() );
     pushButtonRadiusAuto_font.setPointSize( 11 );
     pushButtonRadiusAuto->setFont( pushButtonRadiusAuto_font ); 
     pushButtonRadiusAuto->setText( tr( "auto" ) );
-    QToolTip::add( pushButtonRadiusAuto, tr( "set radius automatically (average #neighbours equal to 8)" ) );
+    pushButtonRadiusAuto->setToolTip(tr( "set radius automatically (average #neighbours equal to 8)" ));
     
     resize( QSize(730, 654).expandedTo(minimumSizeHint()) );
-    clearWState( WState_Polished );
+    //clearWState( WState_Polished );
     
     connect(pushButtonOK,            SIGNAL(clicked()), this, SLOT(accept()));
     connect(pushButtonCancel,        SIGNAL(clicked()), this, SLOT(reject()));
@@ -444,12 +433,12 @@ MULTIPR_GUI_DecimateDlg::~MULTIPR_GUI_DecimateDlg()
 
 void MULTIPR_GUI_DecimateDlg::accept()
 {
-    const char*        strFieldNameTmp = comboBoxSelectFieldName->currentText().latin1();
-    const char*        strFieldIt   = comboBoxSelectFieldIteration->currentText().latin1();
+    const char*        strFieldNameTmp = comboBoxSelectFieldName->currentText().toLatin1();
+    const char*        strFieldIt   = comboBoxSelectFieldIteration->currentText().toLatin1();
     int fieldIteration = atoi(strFieldIt);
 
     char               strFieldName[MED_TAILLE_NOM + 1];
-    const              char* filterName = comboBoxSelectFilter->currentText().latin1();
+    const              char* filterName = comboBoxSelectFilter->currentText().toLatin1();
     char               params[MULTIPR_GUI_MAX_PARAMS_LENGTH];
     int                        i;
 
@@ -476,13 +465,13 @@ void MULTIPR_GUI_DecimateDlg::accept()
     }
     else
     {
-      SUIT_MessageBox::error1(mModule->getAppli()->desktop(),
-                              "Decimation error", 
-                              "Unknown filter name.", 
-                              tr("OK") );
+      SUIT_MessageBox::critical(
+                (QWidget*)mModule->getAppli()->desktop(),
+                "Decimation error", 
+                "Unknown filter name."); 
     }
 
-    QApplication::setOverrideCursor(Qt::waitCursor);
+    QApplication::setOverrideCursor(Qt::WaitCursor);
 
     MULTIPR_ORB::string_array* list = NULL;
     try
@@ -492,7 +481,7 @@ void MULTIPR_GUI_DecimateDlg::accept()
       {
         const QString& partName = (*it);
 
-        list = mModule->getMULTIPRObj()->decimePartition(partName.latin1(),
+        list = mModule->getMULTIPRObj()->decimePartition(partName.toLatin1(),
                                                          strFieldName,
                                                          fieldIteration,
                                                          filterName,
@@ -501,20 +490,18 @@ void MULTIPR_GUI_DecimateDlg::accept()
     }
     catch(...)
     {
-        SUIT_MessageBox::error1
-            mModule->getAppli()->desktop(),
+        SUIT_MessageBox::critical
+            (QWidget*)mModule->getAppli()->desktop(),
             "Decimation error",
-            "Error while decimating selected part(s)",
-            tr("OK") );
+            "Error while decimating selected part(s)");
     }
 
     if (list != NULL && list->length() >= 4)
     {
       const char* rate = (*list)[list->length() - 1];
-      SUIT_MessageBox::info1(mModule->getAppli()->desktop(),
+      SUIT_MessageBox::information((QWidget*)mModule->getAppli()->desktop(),
                              "Compression rate", 
-                             rate,
-                             tr("OK") );
+                             rate);
     }
     QApplication::restoreOverrideCursor();
     QDialog::accept();
@@ -525,51 +512,47 @@ bool MULTIPR_GUI_DecimateDlg::setGradAvgFilterParams(char* pParams)
     int boxing = spinBoxBoxing->value();
 
     double thresholdMed;
-    int ret = sscanf(lineEditTMed->text().latin1(), "%lf", &thresholdMed);
+    int ret = sscanf(lineEditTMed->text().toLatin1(), "%lf", &thresholdMed);
     if ((ret != 1) || (thresholdMed <= 0.0f))
     {
-        SUIT_MessageBox::error1
-            mModule->getAppli()->desktop(),
+        SUIT_MessageBox::critical
+            (QWidget*)mModule->getAppli()->desktop(),
             "Decimation parameters error", 
-            "Invalid medium threshold (should be > 0.0)", 
-            tr("OK") );
+            "Invalid medium threshold (should be > 0.0)");
             
         return false;
     }
 
     double thresholdLow;
-    ret = sscanf(lineEditTLow->text().latin1(), "%lf", &thresholdLow);
+    ret = sscanf(lineEditTLow->text().toLatin1(), "%lf", &thresholdLow);
     if ((ret != 1) || (thresholdLow <= 0.0f))
     {
-        SUIT_MessageBox::error1
-            mModule->getAppli()->desktop(),
+        SUIT_MessageBox::critical
+            (QWidget*)mModule->getAppli()->desktop(),
             "Decimation parameters error", 
-            "Invalid low threshold (should be > 0.0)", 
-            tr("OK") );
+            "Invalid low threshold (should be > 0.0)");
             
         return false;
     }
     
     if (thresholdMed >= thresholdLow)
     {
-        SUIT_MessageBox::error1
-            mModule->getAppli()->desktop(),
+        SUIT_MessageBox::critical
+            (QWidget*)mModule->getAppli()->desktop(),
             "Decimation parameters error", 
-            "Medium threshold must be < low threshold", 
-            tr("OK") );
+            "Medium threshold must be < low threshold");
             
         return false;
     }
 
     double radius;
-    ret = sscanf(lineEditRadius->text().latin1(), "%lf", &radius);
+    ret = sscanf(lineEditRadius->text().toLatin1(), "%lf", &radius);
     if ((ret != 1) || (radius <= 0.0f))
     {
-        SUIT_MessageBox::error1
-            mModule->getAppli()->desktop(),
+        SUIT_MessageBox::critical
+            (QWidget*)mModule->getAppli()->desktop(),
             "Decimation parameters error", 
-            "Invalid radius (should be > 0.0)", 
-            tr("OK") );
+            "Invalid radius (should be > 0.0)");
             
         return false;
     }
@@ -581,41 +564,36 @@ bool MULTIPR_GUI_DecimateDlg::setGradAvgFilterParams(char* pParams)
 
 bool MULTIPR_GUI_DecimateDlg::setDirectFilterParams(char* pParams)
 {
-    int boxing = spinBoxBoxing->value();
-
     double thresholdMed;
-    int ret = sscanf(lineEditTMed->text().latin1(), "%lf", &thresholdMed);
+    int ret = sscanf(lineEditTMed->text().toLatin1(), "%lf", &thresholdMed);
     if (ret != 1)
     {
-        SUIT_MessageBox::error1
-            mModule->getAppli()->desktop(),
+        SUIT_MessageBox::critical
+            (QWidget*)mModule->getAppli()->desktop(),
             "Decimation parameters error", 
-            "Invalid medium threshold.", 
-            tr("OK") );
+            "Invalid medium threshold.");
             
         return false;
     }
 
     double thresholdLow;
-    ret = sscanf(lineEditTLow->text().latin1(), "%lf", &thresholdLow);
+    ret = sscanf(lineEditTLow->text().toLatin1(), "%lf", &thresholdLow);
     if (ret != 1)
     {
-        SUIT_MessageBox::error1
-            mModule->getAppli()->desktop(),
+        SUIT_MessageBox::critical
+            (QWidget*)mModule->getAppli()->desktop(),
             "Decimation parameters error", 
-            "Invalid low threshold.",
-            tr("OK") );
+            "Invalid low threshold.");
             
         return false;
     }
     
     if (thresholdMed >= thresholdLow)
     {
-        SUIT_MessageBox::error1
-            mModule->getAppli()->desktop(),
+        SUIT_MessageBox::critical
+            (QWidget*)mModule->getAppli()->desktop(),
             "Decimation parameters error", 
-            "Medium threshold must be < low threshold", 
-            tr("OK") );
+            "Medium threshold must be < low threshold");
             
         return false;
     }
@@ -647,11 +625,10 @@ void MULTIPR_GUI_DecimateDlg::selectField(const QString& valueText)
        }
        else
        {
-        SUIT_MessageBox::error1(
-            mModule->getAppli()->desktop(),
+        SUIT_MessageBox::critical(
+            (QWidget*)mModule->getAppli()->desktop(),
             "Decimation error", 
-            "Unknown filter name.", 
-            tr("OK") );
+            "Unknown filter name.");
        }
 }
 
@@ -665,9 +642,9 @@ void MULTIPR_GUI_DecimateDlg::OnRadiusAuto()
 {
     // evaluates default radius for the first selected part
     const QStringList& partsList = mModule->getSelectedParts();
-    const char* strFieldIt   = comboBoxSelectFieldIteration->currentText().latin1();
+    const char* strFieldIt   = comboBoxSelectFieldIteration->currentText().toLatin1();
     int fieldIteration = atoi(strFieldIt);
-    char* strPartInfo0 = mModule->getMULTIPRObj()->getPartInfo(partsList[0].latin1());
+    char* strPartInfo0 = mModule->getMULTIPRObj()->getPartInfo(partsList[0].toLatin1());
     
     char   lMeshName[256];
     int    lId;
@@ -688,7 +665,7 @@ void MULTIPR_GUI_DecimateDlg::OnRadiusAuto()
         return;
     }
     
-    QApplication::setOverrideCursor(Qt::waitCursor);
+    QApplication::setOverrideCursor(Qt::WaitCursor);
     float defaultRadius = 0.5f;
     try
     {
@@ -697,9 +674,9 @@ void MULTIPR_GUI_DecimateDlg::OnRadiusAuto()
         
         char* res = mModule->getMULTIPRObj()->evalDecimationParams(
             lPartName,
-            comboBoxSelectFieldName->currentText().latin1(),
+            comboBoxSelectFieldName->currentText().toLatin1(),
             fieldIteration,
-            comboBoxSelectFilter->currentText().latin1(),
+            comboBoxSelectFilter->currentText().toLatin1(),
             strParams);
         
         sscanf(res, "%f", &defaultRadius);
@@ -717,9 +694,9 @@ void MULTIPR_GUI_DecimateDlg::OnThresholdAuto()
 {
     // evaluates default radius for the first selected part
     const QStringList& partsList = mModule->getSelectedParts();
-    const char* strFieldIt  = comboBoxSelectFieldIteration->currentText().latin1();
+    const char* strFieldIt  = comboBoxSelectFieldIteration->currentText().toLatin1();
     int fieldIteration = atoi(strFieldIt);
-    char* strPartInfo0 = mModule->getMULTIPRObj()->getPartInfo(partsList[0].latin1());
+    char* strPartInfo0 = mModule->getMULTIPRObj()->getPartInfo(partsList[0].toLatin1());
     QString filterName = comboBoxSelectFilter->currentText();
 
     char   lMeshName[256];
@@ -736,20 +713,19 @@ void MULTIPR_GUI_DecimateDlg::OnThresholdAuto()
         lPath,
         lMEDFileName);
     
-    QApplication::setOverrideCursor(Qt::waitCursor);
+    QApplication::setOverrideCursor(Qt::WaitCursor);
     if (filterName == "Filtre_GradientMoyen")
     {
         try
         {
             float radius;
-            ret = sscanf(lineEditRadius->text().latin1(), "%f", &radius);
+            ret = sscanf(lineEditRadius->text().toLatin1(), "%f", &radius);
             if ((ret != 1) || (radius <= 0.0f))
             {
-                SUIT_MessageBox::error1
-                    mModule->getAppli()->desktop(),
+                SUIT_MessageBox::critical
+                    (QWidget*)mModule->getAppli()->desktop(),
                     "Decimation parameters error", 
-                    "Invalid radius (should be > 0.0)", 
-                    tr("OK") );
+                    "Invalid radius (should be > 0.0)");
                     
                 return;
             }
@@ -759,9 +735,9 @@ void MULTIPR_GUI_DecimateDlg::OnThresholdAuto()
             
             char* res = mModule->getMULTIPRObj()->evalDecimationParams(
                 lPartName,
-                comboBoxSelectFieldName->currentText().latin1(),
+                comboBoxSelectFieldName->currentText().toLatin1(),
                 fieldIteration,
-                comboBoxSelectFilter->currentText().latin1(),
+                comboBoxSelectFilter->currentText().toLatin1(),
                 strParams);
             
             float gradMin, gradAvg, gradMax;
@@ -779,17 +755,16 @@ void MULTIPR_GUI_DecimateDlg::OnThresholdAuto()
         float   lMin = 1.0f;
         float   lMax = 2.0f;
         
-        mModule->getMULTIPRObj()->getFieldMinMax(lPartName, comboBoxSelectFieldName->currentText().latin1(), lMin, lMax);
+        mModule->getMULTIPRObj()->getFieldMinMax(lPartName, comboBoxSelectFieldName->currentText().toLatin1(), lMin, lMax);
         lineEditTMed->setText(QString::number(lMin));
         lineEditTLow->setText(QString::number(lMax));
     }
     else
        {
-        SUIT_MessageBox::error1(
-            mModule->getAppli()->desktop(),
+        SUIT_MessageBox::critical(
+            (QWidget*)mModule->getAppli()->desktop(),
             "Decimation error", 
-            "Unknown filter name.", 
-            tr("OK") );
+            "Unknown filter name."); 
        }
     QApplication::restoreOverrideCursor();
 }
@@ -802,13 +777,11 @@ void MULTIPR_GUI_DecimateDlg::OnThresholdAuto()
 MULTIPR_GUI_ProgressCallbackDlg::MULTIPR_GUI_ProgressCallbackDlg(QWidget* parent) :
     QProgressDialog(
         parent, 
-        0, 
-        false, 
-        WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+        Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
 {
-    setLabel(new QLabel(this, "Please wait"));
+    setLabel(new QLabel(QString("Please wait"),this));
     setLabelText("Please wait");
-    setTotalSteps(100);
+//    setTotalSteps(100);
 }
 
 
@@ -820,20 +793,20 @@ MULTIPR_GUI_ProgressCallbackDlg::~MULTIPR_GUI_ProgressCallbackDlg()
 
 void MULTIPR_GUI_ProgressCallbackDlg::start(const char* pTaskTitle, int pNumStep)
 {
-    setCaption(pTaskTitle);
+    setWindowTitle(pTaskTitle);
     MULTIPR_ProgressCallback::init(pNumStep);
 }
 
 
 void MULTIPR_GUI_ProgressCallbackDlg::done()
 {
-    setProgress(100);
+    setValue(100);
 }
 
     
 void MULTIPR_GUI_ProgressCallbackDlg::progress(float pPercent)
 {
-    setProgress(int(pPercent));
+    setValue(int(pPercent));
 }
 
 
@@ -859,11 +832,10 @@ void MULTIPR_GUI_EmptyMeshCallbackDlg::reportEmptyMesh(string pInfo)
     char msg[256];
     sprintf(msg, "Empty mesh detected (%s)", pInfo.c_str());
     
-    SUIT_MessageBox::warn1
+    SUIT_MessageBox::warning
         mParent,
         "Empty mesh detected", 
-        msg, 
-        "OK" );
+        msg); 
 }
 
 // EOF