diff --git a/src/qt/forms/masternodelist.ui b/src/qt/forms/masternodelist.ui index 803705b4d..992d6c72d 100644 --- a/src/qt/forms/masternodelist.ui +++ b/src/qt/forms/masternodelist.ui @@ -228,6 +228,9 @@ QAbstractItemView::SelectRows + + QAbstractItemView::NoSelection + true diff --git a/src/qt/masternodelist.cpp b/src/qt/masternodelist.cpp index 9fc06c1b0..6805c320b 100644 --- a/src/qt/masternodelist.cpp +++ b/src/qt/masternodelist.cpp @@ -242,6 +242,11 @@ void MasternodeList::updateMyNodeList(bool fForce) if(nSecondsTillUpdate > 0 && !fForce) return; nTimeMyListUpdated = GetTime(); + // Find selected row + QItemSelectionModel* selectionModel = ui->tableWidgetMyMasternodes->selectionModel(); + QModelIndexList selected = selectionModel->selectedRows(); + int nSelectedRow = selected.count() ? selected.at(0).row() : 0; + ui->tableWidgetMyMasternodes->setSortingEnabled(false); for (const auto& mne : masternodeConfig.getEntries()) { int32_t nOutputIndex = 0; @@ -251,7 +256,7 @@ void MasternodeList::updateMyNodeList(bool fForce) updateMyMasternodeInfo(QString::fromStdString(mne.getAlias()), QString::fromStdString(mne.getIp()), COutPoint(uint256S(mne.getTxHash()), nOutputIndex)); } - ui->tableWidgetMyMasternodes->selectRow(0); + ui->tableWidgetMyMasternodes->selectRow(nSelectedRow); ui->tableWidgetMyMasternodes->setSortingEnabled(true); // reset "timer"