From dbb1adc540a159c9664a1fe8d447b263e2f8258f Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sun, 14 Apr 2024 19:11:02 +0200 Subject: [PATCH] [SIDAddChannelsDialog] Make columns sortable --- plugins/feature/sid/sidaddchannelsdialog.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/feature/sid/sidaddchannelsdialog.cpp b/plugins/feature/sid/sidaddchannelsdialog.cpp index cad94cf91b..6e3eb226ad 100644 --- a/plugins/feature/sid/sidaddchannelsdialog.cpp +++ b/plugins/feature/sid/sidaddchannelsdialog.cpp @@ -53,6 +53,7 @@ SIDAddChannelsDialog::SIDAddChannelsDialog(SIDSettings *settings, QWidget* paren } // Add row for each transmitter, with checkbox for each device + ui->channels->setSortingEnabled(false); for (int j = 0; j < VLFTransmitters::m_transmitters.size(); j++) { int row = ui->channels->rowCount(); @@ -60,6 +61,7 @@ SIDAddChannelsDialog::SIDAddChannelsDialog(SIDSettings *settings, QWidget* paren ui->channels->setItem(row, COL_TX_NAME, new QTableWidgetItem(VLFTransmitters::m_transmitters[j].m_callsign)); ui->channels->setItem(row, COL_TX_FREQUENCY, new QTableWidgetItem(QString::number(VLFTransmitters::m_transmitters[j].m_frequency))); + ui->channels->item(row, COL_TX_FREQUENCY)->setTextAlignment(Qt::AlignRight | Qt::AlignVCenter); for (unsigned int i = 0; i < deviceSets.size(); i++) { @@ -72,7 +74,8 @@ SIDAddChannelsDialog::SIDAddChannelsDialog(SIDSettings *settings, QWidget* paren } } } - + ui->channels->sortItems(COL_TX_FREQUENCY); + ui->channels->setSortingEnabled(true); ui->channels->resizeColumnsToContents(); }