mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 16:00:08 +00:00
Fix radar site selection when filtering and the selected item changes index
This commit is contained in:
parent
43e0d69379
commit
384cfb53ed
1 changed files with 10 additions and 2 deletions
|
|
@ -76,9 +76,17 @@ RadarSiteDialog::RadarSiteDialog(QWidget* parent) :
|
|||
connect(ui->radarSiteView->selectionModel(),
|
||||
&QItemSelectionModel::selectionChanged,
|
||||
this,
|
||||
[=](const QItemSelection& selected,
|
||||
const QItemSelection& /* deselected */)
|
||||
[=](const QItemSelection& selected, const QItemSelection& deselected)
|
||||
{
|
||||
if (selected.size() == 0 && deselected.size() == 0)
|
||||
{
|
||||
// Items which stay selected but change their index are not
|
||||
// included in selected and deselected. Thus, this signal might
|
||||
// be emitted with both selected and deselected empty, if only
|
||||
// the indices of selected items change.
|
||||
return;
|
||||
}
|
||||
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)
|
||||
->setEnabled(selected.size() > 0);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue