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;
qDebug() << "file error for:" << filename;
return false;
}
+ endResetModel();
emit layoutChanged();
- endInsertRows();
return true;
}