#include <QTableWidget>
#include <QTableWidgetItem>
+#include <QHeaderView>
#include <QtxDoubleSpinBox.h>
//aLabels << tr( "SECTION_LABEL" ) << tr( "IDENTIFIER_LABEL" ) << aCoord1 << aCoord2;
aLabels << tr( "TABLE_SECTION" ) << tr("TABLE_INDEX") << aCoord1 << aCoord2;
setHorizontalHeaderLabels( aLabels );
+
+ connect( horizontalHeader(), SIGNAL( sectionClicked( int ) ), this, SLOT( OnHeaderClick( int ) ) );
}
void CurveCreator_TableView::setCurve( CurveCreator_ICurve* theCurve )
QTableWidgetItem* anItem;
anItem = new QTableWidgetItem( myCurve->getSectionName( anISection ).c_str() );
- anItem->setFlags( anItem->flags() & ~Qt::ItemIsEnabled );
+ anItem->setFlags( anItem->flags() & ~Qt::ItemIsEditable );
anItem->setData( Qt::UserRole, anISection );
setItem( aRowId, 0, anItem );
{
return item( theRowId, 1 )->data( Qt::UserRole ).toInt();
}
+
+void CurveCreator_TableView::OnHeaderClick( int theLogicalId )
+{
+ sortByColumn( theLogicalId, Qt::AscendingOrder );
+}