Launcher: fix QML warnings closing notifications
This commit is contained in:
parent
5738d8cca9
commit
df0f3e1b47
1 changed files with 12 additions and 3 deletions
|
@ -69,10 +69,19 @@ public:
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void removeIndex(int index)
|
void removeIndex(int row)
|
||||||
{
|
{
|
||||||
beginRemoveRows({}, index, index);
|
// work aroud the role-by-role destruction order of model data
|
||||||
_data.erase(_data.begin() + index);
|
// clear out the source first so the Loader unloads, before we
|
||||||
|
// null args. This avoids 'args is null' warnings from the loaded
|
||||||
|
// notification
|
||||||
|
_data[row].source.clear();
|
||||||
|
const auto idx = index(row, 0);
|
||||||
|
emit dataChanged(idx, idx, {SourceRole});
|
||||||
|
|
||||||
|
// now we can remove everything else
|
||||||
|
beginRemoveRows({}, row, row);
|
||||||
|
_data.erase(_data.begin() + row);
|
||||||
endRemoveRows();
|
endRemoveRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue