Skip to content

Commit

Permalink
fix: keep sorting when editing monitors (fix #3134)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Apr 20, 2024
1 parent 72352a2 commit 952ca4b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/gui/src/tabs/monitors-tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ MonitorsTab::MonitorsTab(Profile *profile, MonitorManager *monitorManager, Monit
ui->tableMonitors->setModel(m_monitorTableModel);
connect(m_monitoringCenter, &MonitoringCenter::statusChanged, monitorTableModel, &MonitorTableModel::setStatus);

// Re-trigger sort on insert (FIXME: we shouldn't need to do this)
connect(m_monitorTableModel, &MonitorTableModel::rowsInserted, [=]() {
QTimer::singleShot(1, [=]() {
m_monitorTableModel->invalidate();
});
});

auto *actionRemoveSelected = new QShortcut(QKeySequence::Delete, ui->tableMonitors);
actionRemoveSelected->setContext(Qt::WidgetWithChildrenShortcut);
connect(actionRemoveSelected, &QShortcut::activated, this, &MonitorsTab::removeSelected);
Expand Down

0 comments on commit 952ca4b

Please # to comment.