mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Avoid Q_ASSERT with debug build of Qt
I don't know why we are setting lastIndex to -1. That seems odd. But for now this workaround will have to do. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
49a368539a
commit
29741f0ed2
1 changed files with 7 additions and 0 deletions
|
@ -124,6 +124,13 @@ Qt::ItemFlags DiveImportedModel::flags(const QModelIndex &index) const
|
||||||
|
|
||||||
void DiveImportedModel::clearTable()
|
void DiveImportedModel::clearTable()
|
||||||
{
|
{
|
||||||
|
if (lastIndex < firstIndex) {
|
||||||
|
// just to be sure it's the right numbers
|
||||||
|
// but don't call RemoveRows or Qt in debug mode with trigger an ASSERT
|
||||||
|
lastIndex = -1;
|
||||||
|
firstIndex = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
beginRemoveRows(QModelIndex(), 0, lastIndex - firstIndex);
|
beginRemoveRows(QModelIndex(), 0, lastIndex - firstIndex);
|
||||||
lastIndex = -1;
|
lastIndex = -1;
|
||||||
firstIndex = 0;
|
firstIndex = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue