Salome HOME
Double editor in table
[modules/hydro.git] / src / HYDROCurveCreator / CurveCreator_Widget.cxx
index 511810438fad8014df53312582e487d0e477eda9..56ae6c123358bb31b87f131dac788d00fccb8e93 100644 (file)
@@ -25,6 +25,7 @@
 //#include "CurveCreator_NewPointDlg.h"
 #include "CurveCreator_NewSectionDlg.h"
 #include "CurveCreator_Utils.h"
+#include "CurveCreator_TableView.h"
 
 #include <SUIT_Session.h>
 #include <SUIT_Desktop.h>
@@ -96,6 +97,7 @@ CurveCreator_Widget::CurveCreator_Widget(QWidget* parent,
   connect( mySectionView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onContextMenu(QPoint)) );
 
   myLocalPointView = new QTableWidget();
+  myLocalPointView->setItemDelegate( new CurveCreator_TableItemDelegate( myLocalPointView ) );
   myLocalPointView->setVisible( false );
   myLocalPointView->setColumnCount( 4 );
   myLocalPointView->setColumnWidth( 0, SECTION_NAME_COLUMN_WIDTH );
@@ -974,8 +976,8 @@ void CurveCreator_Widget::onCellChanged( int theRow, int theColumn )
   SectionToPointList aSelPoints;
   startCurveModification( aSelPoints );
 
-  double aX  = myLocalPointView->item( theRow, 2 )->text().toDouble();
-  double anY = myLocalPointView->item( theRow, 3 )->text().toDouble();
+  double aX  = myLocalPointView->item( theRow, 2 )->data( Qt::UserRole ).toDouble();
+  double anY = myLocalPointView->item( theRow, 3 )->data( Qt::UserRole ).toDouble();
   std::deque<float> aChangedPos;
   aChangedPos.push_back( aX );
   aChangedPos.push_back( anY );