mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-02-03 23:20:33 +05:00
refs #1331: sorting of profiles points by column
This commit is contained in:
parent
0cf86bb835
commit
81f3aca1cb
@ -94,10 +94,13 @@ void CurveCreator_TableItemDelegate::setModelData( QWidget* theEditor,
|
|||||||
QItemDelegate::setModelData( theEditor, theModel, theIndex );
|
QItemDelegate::setModelData( theEditor, theModel, theIndex );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CurveCreator_TableView::CurveCreator_TableView( CurveCreator_ICurve* theCurve,
|
CurveCreator_TableView::CurveCreator_TableView( CurveCreator_ICurve* theCurve,
|
||||||
QWidget* theParent,
|
QWidget* theParent,
|
||||||
const QStringList& theCoordTitles )
|
const QStringList& theCoordTitles )
|
||||||
: QTableWidget( theParent ), myCurve( theCurve )
|
: QTableWidget( theParent ), myCurve( theCurve ), myCurrentSortId( -1 ), myCurrentSortOrder( Qt::AscendingOrder )
|
||||||
{
|
{
|
||||||
setItemDelegate( new CurveCreator_TableItemDelegate( this ) );
|
setItemDelegate( new CurveCreator_TableItemDelegate( this ) );
|
||||||
setVisible( false );
|
setVisible( false );
|
||||||
@ -199,5 +202,12 @@ int CurveCreator_TableView::getPointId( const int theRowId ) const
|
|||||||
|
|
||||||
void CurveCreator_TableView::OnHeaderClick( int theLogicalId )
|
void CurveCreator_TableView::OnHeaderClick( int theLogicalId )
|
||||||
{
|
{
|
||||||
sortByColumn( theLogicalId, Qt::AscendingOrder );
|
if( theLogicalId == myCurrentSortId )
|
||||||
|
if( myCurrentSortOrder == Qt::AscendingOrder )
|
||||||
|
myCurrentSortOrder = Qt::DescendingOrder;
|
||||||
|
else
|
||||||
|
myCurrentSortOrder = Qt::AscendingOrder;
|
||||||
|
|
||||||
|
sortByColumn( theLogicalId, myCurrentSortOrder );
|
||||||
|
myCurrentSortId = theLogicalId;
|
||||||
}
|
}
|
||||||
|
@ -69,6 +69,8 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
CurveCreator_ICurve* myCurve;
|
CurveCreator_ICurve* myCurve;
|
||||||
|
|
||||||
|
int myCurrentSortId;
|
||||||
|
Qt::SortOrder myCurrentSortOrder;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CURVECREATOR_TABLEVIEW_H
|
#endif // CURVECREATOR_TABLEVIEW_H
|
||||||
|
Loading…
Reference in New Issue
Block a user