Skip to content

Commit

Permalink
[SIDAddChannelsDialog] Make columns sortable
Browse files Browse the repository at this point in the history
  • Loading branch information
dforsi committed Apr 14, 2024
1 parent 0cd8800 commit dbb1adc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/feature/sid/sidaddchannelsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ 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();
ui->channels->setRowCount(row+1);

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++)
{
Expand All @@ -72,7 +74,8 @@ SIDAddChannelsDialog::SIDAddChannelsDialog(SIDSettings *settings, QWidget* paren
}
}
}

ui->channels->sortItems(COL_TX_FREQUENCY);
ui->channels->setSortingEnabled(true);
ui->channels->resizeColumnsToContents();
}

Expand Down

0 comments on commit dbb1adc

Please sign in to comment.