Salome HOME
Fix of IPAL19633 (Qt4 porting. Strange value of Tolerance when use spin box): set...
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ComputeDlg.cxx
index 05dbee7175825608cfab043be8c5d45ae0369ce6..6d7036a6336cdf48c807e0a754c61eff750ce5cb 100644 (file)
@@ -77,6 +77,7 @@
 #include <QGridLayout>
 #include <QHBoxLayout>
 #include <QVBoxLayout>
+#include <QButtonGroup>
 
 // VTK includes
 #include <vtkProperty.h>
@@ -181,7 +182,7 @@ namespace SMESH
     // -----------------------------------------------------------------------
     bool HasReadyActorsFor (int subShapeID, GEOM::GEOM_Object_var aMainShape )
     {
-      string mainEntry;
+      std::string mainEntry;
       if ( !aMainShape->_is_nil() )
         mainEntry = aMainShape->GetStudyEntry();
       return ( myMainEntry == mainEntry &&
@@ -191,7 +192,7 @@ namespace SMESH
     void Show( int subShapeID, GEOM::GEOM_Object_var aMainShape, bool only = false)
     {
       SVTK_ViewWindow* aViewWindow  = SMESH::GetViewWindow( SMESHGUI::GetSMESHGUI() );
-      string mainEntry;
+      std::string mainEntry;
       if ( !aMainShape->_is_nil() )
         mainEntry = aMainShape->GetStudyEntry();
       if ( myMainEntry != mainEntry || aViewWindow != myViewWindow ) { // remove actors
@@ -242,7 +243,7 @@ namespace SMESH
     TActorVec                  myActors;
     TActorVec                  myShownActors;
     TopTools_IndexedMapOfShape myIndexToShape;
-    string                     myMainEntry;
+    std::string                myMainEntry;
     SVTK_ViewWindow*           myViewWindow;
     vtkProperty*               myProperty;
     std::set<int>              myBuiltSubs;
@@ -457,8 +458,8 @@ SMESHGUI_MeshInfosBox::SMESHGUI_MeshInfosBox(const bool full, QWidget* theParent
   : QGroupBox( tr("SMESH_MESHINFO_TITLE"), theParent ), myFull( full )
 {
   QGridLayout* l = new QGridLayout(this);
-  l->setMargin( 0 );
-  l->setSpacing( 0 );
+  l->setMargin( MARGIN );
+  l->setSpacing( SPACING );
 
   QFont italic = font(); italic.setItalic(true);
   QFont bold   = font(); bold.setBold(true);
@@ -812,6 +813,7 @@ QFrame* SMESHGUI_ComputeDlg::createMainFrame (QWidget* theParent)
   // constructor
 
   QGroupBox* aPixGrp = new QGroupBox(tr("CONSTRUCTOR"), aFrame);
+  QButtonGroup* aBtnGrp = new QButtonGroup(this);
   QHBoxLayout* aPixGrpLayout = new QHBoxLayout(aPixGrp);
   aPixGrpLayout->setMargin(MARGIN); aPixGrpLayout->setSpacing(SPACING);
 
@@ -819,7 +821,7 @@ QFrame* SMESHGUI_ComputeDlg::createMainFrame (QWidget* theParent)
   aRBut->setIcon(iconCompute);
   aRBut->setChecked(true);
   aPixGrpLayout->addWidget(aRBut);
-  aPixGrpLayout->addStretch();
+  aBtnGrp->addButton(aRBut, 0);
 
   // Mesh name
 
@@ -1098,15 +1100,26 @@ void SMESHGUI_ComputeOp::startOperation()
       for ( int row = 0; row < aCompErrors->length(); ++row )
       {
         SMESH::ComputeError & err = aCompErrors[ row ];
-        tbl->item( row, COL_ALGO )->setText( err.algoName.in() );
-        tbl->item( row, COL_ERROR )->setText( SMESH::errorText( err.code, err.comment.in() ));
-        tbl->item( row, COL_SHAPEID )->setText( QString("%1").arg( err.subShapeID ));
 
-        QString text = hasShape ? SMESH::shapeText( err.subShapeID, myMainShape ) : QString("");
-        tbl->item( row, COL_SHAPE )->setText( text );
+       QString text = err.algoName.in();
+       if ( !tbl->item( row, COL_ALGO ) ) tbl->setItem( row, COL_ALGO, new QTableWidgetItem( text ) );
+       else tbl->item( row, COL_ALGO )->setText( text );
+
+       text = SMESH::errorText( err.code, err.comment.in() );
+       if ( !tbl->item( row, COL_ERROR ) ) tbl->setItem( row, COL_ERROR, new QTableWidgetItem( text ) );
+       else tbl->item( row, COL_ERROR )->setText( text );
+
+       text = QString("%1").arg( err.subShapeID );
+       if ( !tbl->item( row, COL_SHAPEID ) ) tbl->setItem( row, COL_SHAPEID, new QTableWidgetItem( text ) );
+       else tbl->item( row, COL_SHAPEID )->setText( text );
+
+        text = hasShape ? SMESH::shapeText( err.subShapeID, myMainShape ) : QString("");
+       if ( !tbl->item( row, COL_SHAPE ) ) tbl->setItem( row, COL_SHAPE, new QTableWidgetItem( text ) );
+       else tbl->item( row, COL_SHAPE )->setText( text );
 
         text = ( !hasShape || SMESH::getSubShapeSO( err.subShapeID, myMainShape )) ? "PUBLISHED" : "";
-        tbl->item( row, COL_PUBLISHED )->setText( text ); // if text=="", "PUBLISH" button enabled
+       if ( !tbl->item( row, COL_PUBLISHED ) ) tbl->setItem( row, COL_PUBLISHED, new QTableWidgetItem( text ) );
+       else tbl->item( row, COL_PUBLISHED )->setText( text ); // if text=="", "PUBLISH" button enabled
 
         //tbl->item( row, COL_ERROR )->setWordWrap( true ); // VSR: TODO ???
         tbl->resizeRowToContents( row );