Port models away from deprecated Qt5 API
This commit is contained in:
parent
959d7c89a9
commit
42050df412
3 changed files with 6 additions and 9 deletions
|
@ -109,11 +109,10 @@ void DanbooruPoolModel::clear()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
beginRemoveRows(QModelIndex(), 0, m_items.size());
|
beginResetModel();
|
||||||
qDeleteAll(m_items);
|
qDeleteAll(m_items);
|
||||||
m_items.clear();
|
m_items.clear();
|
||||||
endRemoveRows();
|
endResetModel();
|
||||||
reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DanbooruPool* DanbooruPoolModel::poolAt(int index) const
|
DanbooruPool* DanbooruPoolModel::poolAt(int index) const
|
||||||
|
|
|
@ -126,11 +126,10 @@ void DanbooruPostModel::clear()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
beginRemoveRows(QModelIndex(), 0, m_items.size());
|
beginResetModel();
|
||||||
qDeleteAll(m_items);
|
qDeleteAll(m_items);
|
||||||
m_items.clear();
|
m_items.clear();
|
||||||
endRemoveRows();
|
endResetModel();
|
||||||
reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QHash< int, QByteArray > DanbooruPostModel::roleNames() const
|
QHash< int, QByteArray > DanbooruPostModel::roleNames() const
|
||||||
|
|
|
@ -92,11 +92,10 @@ void DanbooruTagModel::clear() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
beginRemoveRows(QModelIndex(), 0, m_items.size());
|
beginResetModel();
|
||||||
qDeleteAll(m_items);
|
qDeleteAll(m_items);
|
||||||
m_items.clear();
|
m_items.clear();
|
||||||
endRemoveRows();
|
endResetModel();
|
||||||
reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Danbooru
|
} // namespace Danbooru
|
Loading…
Add table
Add a link
Reference in a new issue