do not remove if not count
This commit is contained in:
parent
a7678b2a2a
commit
9413c882dc
|
|
@ -101,9 +101,11 @@ QVariant SqlModel::data(const QModelIndex &index, int role) const
|
|||
void SqlModel::setRows(RowList<Table> rows)
|
||||
{
|
||||
d.detach();
|
||||
if (d->rows.count()) {
|
||||
beginRemoveRows(QModelIndex(), 0, d->rows.count());
|
||||
d->rows.clear();
|
||||
endRemoveRows();
|
||||
}
|
||||
beginInsertRows(QModelIndex(), 0, rows.count());
|
||||
d->rows = rows;
|
||||
endInsertRows();
|
||||
|
|
|
|||
Loading…
Reference in New Issue