refs #739: correct sorting of numerical data for columns in the table of local points.

This commit is contained in:
mkr 2015-11-24 18:38:51 +03:00
parent 643db5d3ff
commit 40d1576437

View File

@ -141,6 +141,7 @@ void CurveCreator_TableView::setLocalPointsToTable(
anItem = new QTableWidgetItem( QString::number( anIPoint + 1 ) );
anItem->setFlags( anItem->flags() & ~Qt::ItemIsEnabled );
anItem->setData( Qt::UserRole, anIPoint );
anItem->setData( Qt::DisplayRole, anIPoint );
setItem( aRowId, 1, anItem );
gp_Pnt aPoint;
@ -152,7 +153,7 @@ void CurveCreator_TableView::setLocalPointsToTable(
setItem( aRowId, 2, anItem );
}
anItem->setData( Qt::UserRole, aPoint.X() );
anItem->setData( Qt::DisplayRole, QString::number( aPoint.X(), 'f', 2 ) );
anItem->setData( Qt::DisplayRole, QString::number( aPoint.X(), 'f', 2 ).toDouble() );
anItem = item( aRowId, 3 );
if ( !anItem ) {
@ -160,7 +161,7 @@ void CurveCreator_TableView::setLocalPointsToTable(
setItem( aRowId, 3, anItem );
}
anItem->setData( Qt::UserRole, aPoint.Y() );
anItem->setData( Qt::DisplayRole, QString::number( aPoint.Y(), 'f', 2 ) );
anItem->setData( Qt::DisplayRole, QString::number( aPoint.Y(), 'f', 2 ).toDouble() );
aRowId++;
}