projects
/
quandoparte
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d009477
)
Use (begin/end)ResetModel() when loading items in the model
author
Luciano Montanaro
<mikelima@cirulla.net>
Sun, 11 Dec 2011 20:54:06 +0000
(21:54 +0100)
committer
Luciano Montanaro
<mikelima@cirulla.net>
Tue, 27 Dec 2011 22:19:13 +0000
(23:19 +0100)
application/stationlistmodel.cpp
patch
|
blob
|
history
diff --git
a/application/stationlistmodel.cpp
b/application/stationlistmodel.cpp
index
1dc66b8
..
e370016
100644
(file)
--- a/
application/stationlistmodel.cpp
+++ b/
application/stationlistmodel.cpp
@@
-44,7
+44,7
@@
bool StationListModel::load(const QString &filename)
qDebug() << "loading file:" << fi.absoluteFilePath();
emit layoutAboutToBeChanged();
- beginInsertRows(QModelIndex(), 0, 0);
+ beginResetModel();
if (!file.open(QFile::ReadOnly | QFile::Text)) {
qDebug() << "cannot open file:" << filename;
return false;
@@
-70,8
+70,8
@@
bool StationListModel::load(const QString &filename)
qDebug() << "file error for:" << filename;
return false;
}
+ endResetModel();
emit layoutChanged();
- endInsertRows();
return true;
}