diff --git a/catalogmodel.cpp b/catalogmodel.cpp index cd8cd51..60942aa 100644 --- a/catalogmodel.cpp +++ b/catalogmodel.cpp @@ -45,9 +45,9 @@ void CCatalogModel::onLanguageChanged() void CCatalogModel::setModelData (CCatalog *pCatalog) { - reset(); + beginResetModel(); m_pCatalog = pCatalog; - reset(); + endResetModel(); } int CCatalogModel::columnCount (const QModelIndex& parent) const diff --git a/chaptermodel.cpp b/chaptermodel.cpp index 31b1673..b1f8150 100644 --- a/chaptermodel.cpp +++ b/chaptermodel.cpp @@ -45,16 +45,18 @@ void CChapterModel::onLanguageChanged() void CChapterModel::clear() { + beginResetModel(); m_listChapter.clear(); m_pCatalog = 0; - reset(); + endResetModel(); } void CChapterModel::setModelData (CCatalog *pCatalog, QList listChapter) { + beginResetModel(); m_listChapter = listChapter; m_pCatalog = pCatalog; - reset(); + endResetModel(); } int CChapterModel::columnCount (const QModelIndex & parent) const diff --git a/questionmodel.cpp b/questionmodel.cpp index 23417ec..b049e38 100644 --- a/questionmodel.cpp +++ b/questionmodel.cpp @@ -40,14 +40,16 @@ void CQuestionModel::onLanguageChanged() void CQuestionModel::clear() { + beginResetModel(); m_pChapter=0; - reset(); + endResetModel(); } void CQuestionModel::setModelData (CChapter *pChapter) { + beginResetModel(); m_pChapter = pChapter; - reset(); + endResetModel(); } int CQuestionModel::columnCount (const QModelIndex & parent) const