]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix of IPAL19325(Segmentation violation on Selection Info - Cell) and minor GUI bug.
authorakl <akl@opencascade.com>
Mon, 24 Mar 2008 08:22:00 +0000 (08:22 +0000)
committerakl <akl@opencascade.com>
Mon, 24 Mar 2008 08:22:00 +0000 (08:22 +0000)
src/VISUGUI/VisuGUI_Selection.cxx

index 39c77fb475745ab4e0710895e7939ac44de78943..044de3752bfb34da9ca7a4cc45d3efc10cd98eed 100644 (file)
@@ -280,7 +280,7 @@ VisuGUI_SelectionDlg::VisuGUI_SelectionDlg (const SalomeApp_Module* theModule):
   aGridLay->addWidget( myXPosLbl, 0, 1);
   aGridLay->addWidget( new QLabel ("Y:", aPosGrp), 1, 0);
   myYPosLbl = new QLabel ("0", aPosGrp);
-  aGridLay->addWidget( myYPosLbl, 2, 1);
+  aGridLay->addWidget( myYPosLbl, 1, 1);
   aGridLay->addWidget( new QLabel ("Z:", aPosGrp), 2, 0);
   myZPosLbl = new QLabel ("0", aPosGrp);
   aGridLay->addWidget( myZPosLbl, 2, 1);
@@ -543,7 +543,7 @@ void VisuGUI_SelectionDlg::onSelectionEvent() {
 
       const VISU::PIDMapper& aMapper = aPrs3d->GetPipeLine()->GetIDMapper();
       for (int i = 0; anIter != aPointCoordsMap.end() && i < myListPoints->rowCount(); anIter++, i++) {
-        myListPoints->verticalHeaderItem(i)->setText( QString::number( i ));
+       myListPoints->model()->setHeaderData( i, Qt::Vertical, QVariant(QString::number( i )), Qt::DisplayRole );
         vtkIdType aNodeObjId = anIter->first;
        //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
        VISU::TIdTypeVector aVec = aMapper->GetIndexesOfNode(aNodeObjId);
@@ -562,18 +562,19 @@ void VisuGUI_SelectionDlg::onSelectionEvent() {
        }
        //ENK: 23.11.2006
 
-        myListPoints->item(i,0)->setText( QString::number( aNodeObjId ));
+       QAbstractItemModel* aModel = myListPoints->model();
+       aModel->setData( aModel->index(i,0), QVariant(QString::number( aNodeObjId )), Qt::DisplayRole );
         const TCoordArray& aCoordArray = anIter->second;
-        myListPoints->item(i,1)->setText( QString::number( aCoordArray[0] ));
-        myListPoints->item(i,2)->setText( QString::number( aCoordArray[1] ));
-        myListPoints->item(i,3)->setText( QString::number( aCoordArray[2] ));
-        myListPoints->item(i,4)->setText( aI);//ENK: 23.11.2006 - PAL13176
-        myListPoints->item(i,5)->setText( aJ);//ENK: 23.11.2006 - PAL13176
-        myListPoints->item(i,6)->setText( aK);//ENK: 23.11.2006 - PAL13176
+       aModel->setData( aModel->index(i,1), QVariant(QString::number( aCoordArray[0] )), Qt::DisplayRole );
+       aModel->setData( aModel->index(i,2), QVariant(QString::number( aCoordArray[1] )), Qt::DisplayRole );
+       aModel->setData( aModel->index(i,3), QVariant(QString::number( aCoordArray[2] )), Qt::DisplayRole );
+       aModel->setData( aModel->index(i,4), QVariant( aI ), Qt::DisplayRole );//ENK: 23.11.2006 - PAL13176
+       aModel->setData( aModel->index(i,5), QVariant( aJ ), Qt::DisplayRole );//ENK: 23.11.2006 - PAL13176
+       aModel->setData( aModel->index(i,6), QVariant( aK ), Qt::DisplayRole );//ENK: 23.11.2006 - PAL13176
 
        vtkIdType aNodeVTKId = anVISUActor->GetNodeVTKID(aNodeObjId);
-        myListPoints->item(i,7)->setText( getValue(aPntData, aNodeVTKId));
-        myListPoints->item(i,8)->setText( getVector(aPntData, aNodeVTKId));
+       aModel->setData( aModel->index(i,7), QVariant(getValue(aPntData, aNodeVTKId)), Qt::DisplayRole );
+       aModel->setData( aModel->index(i,8), QVariant(getVector(aPntData, aNodeVTKId)), Qt::DisplayRole );
       }
       //for(int aColumnId = 0; aColumnId < 9; aColumnId++)
       myListPoints->resizeColumnsToContents();