try basic code from SO

This commit is contained in:
Ubuntu
2017-10-25 12:19:26 -07:00
parent 45692d3ad5
commit 88bd90f51a
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -54,6 +54,7 @@ MainWindow::MainWindow(QWidget *parent) :
ui->canFramesView->setColumnWidth(6, 225);
QHeaderView *HorzHdr = ui->canFramesView->horizontalHeader();
HorzHdr->setStretchLastSection(true); //causes the data column to automatically fill the tableview
connect(HorzHdr, SIGNAL(sectionClicked(int)), this, SLOT(on_sectionClicked(int)));
graphingWindow = NULL;
frameInfoWindow = NULL;
@@ -234,6 +235,13 @@ void MainWindow::closeEvent(QCloseEvent *event)
exitApp();
}
void MainWindow::on_sectionClicked ( int logicalIndex )
{
QHeaderView *HorzHdr = ui->canFramesView->horizontalHeader();
HorzHdr->setSortIndicator(logicalIndex, Qt::AscendingOrder);
ui->canFramesView->sortByColumn(logicalIndex);
}
void MainWindow::updateSettings()
{
readUpdateableSettings();
+1
View File
@@ -102,6 +102,7 @@ public slots:
void readUpdateableSettings();
void gotCenterTimeID(int32_t ID, double timestamp);
void updateConnectionSettings(QString connectionType, QString port, int speed0, int speed1);
void on_sectionClicked ( int logicalIndex );
signals:
void sendCANFrame(const CANFrame *, int);