--- a/src/documentmanager.cpp Wed Jul 20 21:35:55 2022 +0300 +++ b/src/documentmanager.cpp Wed Jul 20 21:48:46 2022 +0300 @@ -54,7 +54,7 @@ return modelId; } -Model* DocumentManager::findDependencyByName(const ModelId modelId, const QString& name) +QTextDocument* DocumentManager::findDependencyByName(const ModelId modelId, const QString& name) { const auto modelsIterator = this->openModels.find(modelId); if (modelsIterator != std::end(this->openModels)) { @@ -78,7 +78,7 @@ * @param modelId id of model to find * @returns model pointer or null */ -Model *DocumentManager::getModelById(ModelId modelId) +QTextDocument *DocumentManager::getModelById(ModelId modelId) { const auto iterator = this->openModels.find(modelId); if (iterator != this->openModels.end()) @@ -228,7 +228,7 @@ * @param model model to look for * @return id or no value if not found */ -std::optional<ModelId> DocumentManager::findIdForModel(const Model *model) const +std::optional<ModelId> DocumentManager::findIdForModel(const QTextDocument *model) const { std::optional<ModelId> result; for (auto it = this->openModels.begin(); it != this->openModels.end(); ++it) @@ -325,7 +325,7 @@ void DocumentManager::makePolygonCacheForModel(const ModelId modelId) { - Model* model = this->getModelById(modelId); + QTextDocument* model = this->getModelById(modelId); if (model != nullptr) { const auto modelModified = [this, model]{ @@ -358,7 +358,7 @@ return referencedFilePath; } -static std::set<QString> referenceNames(const Model* model) +static std::set<QString> referenceNames(const QTextDocument* model) { std::set<QString> result; for (const QString& line : model->toPlainText().split("\n")) {