Коммит 22ef53d1 создал по автору OMP Education's avatar OMP Education Зафиксировано автором Alexey Andreyev
Просмотр файлов
владелец 1fa6b259
/****************************************************************************
**
** Copyright (C) 2022 Open Mobile Platform LLC.
** Copyright (C) 2022 - 2023 Open Mobile Platform LLC.
** Contact: https://community.omprussia.ru/open-source
**
** This file is part of the AmberPDF-QML-Plugin project.
......
/****************************************************************************
**
** Copyright (C) 2022 Open Mobile Platform LLC.
** Copyright (C) 2022 - 2023 Open Mobile Platform LLC.
** Contact: https://community.omprussia.ru/open-source
**
** This file is part of the AmberPDF-QML-Plugin project.
......@@ -100,6 +100,8 @@ void PagesWithNotesModel::setNewData(BaseDocument *provider)
m_documentProvider = provider;
connect(m_documentProvider, &BaseDocument::pageLoaded, this, &PagesWithNotesModel::_addPage);
beginResetModel();
endResetModel();
}
void PagesWithNotesModel::_addPage(int pageIndex)
......@@ -121,7 +123,7 @@ void PagesWithNotesModel::_addPage(int pageIndex)
connect(notesModel, &NotesModel::loadingChanged, this, [this, pageIndex](bool loading) {
Q_UNUSED(loading)
emit dataChanged(index(pageIndex), index(pageIndex), { LoadingRole });
emit dataChanged(index(pageIndex), index(pageIndex), { LoadingRole, CountRole });
});
notesModel->setPageSource(page);
......
/****************************************************************************
**
** Copyright (C) 2022 Open Mobile Platform LLC.
** Copyright (C) 2022 - 2023 Open Mobile Platform LLC.
** Contact: https://community.omprussia.ru/open-source
**
** This file is part of the AmberPDF-QML-Plugin project.
......@@ -69,7 +69,7 @@ private slots:
void _addPage(int pageIndex);
private:
BaseDocument *m_documentProvider;
BaseDocument *m_documentProvider = nullptr;
QMap<int, NotesModel *> m_notesModels;
};
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать