--- a/src/documentmanager.h Sat Jul 23 01:38:06 2022 +0300 +++ b/src/documentmanager.h Sat Jul 23 01:38:43 2022 +0300 @@ -48,8 +48,8 @@ auto begin() const { return this->openModels.begin(); } auto end() const { return this->openModels.end(); } ModelId newModel(); - Model* findDependencyByName(const ModelId modelId, const QString& name); - Model* getModelById(ModelId modelId); + QTextDocument* findDependencyByName(const ModelId modelId, const QString& name); + QTextDocument* getModelById(ModelId modelId); std::optional<ModelId> openModel(const QString& path, QTextStream& errorStream, const OpenType openType); std::map<QString, QString> loadDependenciesForAllModels(const LibrariesModel &libraries); void closeDocument(const ModelId modelId); @@ -60,7 +60,7 @@ const LibrariesModel &libraries, QTextStream &errorStream); bool saveModel(const ModelId modelId, QTextStream& errors); - std::optional<ModelId> findIdForModel(const Model* model) const; + std::optional<ModelId> findIdForModel(const QTextDocument* model) const; PolygonCache* getPolygonCacheForModel(ModelId modelId); const ModelInfo* find(ModelId modelId) const; void setModelPayload(ModelId modelId, QObject* object); @@ -75,7 +75,7 @@ private: int modelIdCounter = 0; std::map<ModelId, ModelInfo> openModels; - void collectReferences(QSet<QString> &referenced, const QString& name, const Model* model); + void collectReferences(QSet<QString> &referenced, const QString& name, const QTextDocument* model); void updateDependencies(ModelInfo* model); void prune(); void makePolygonCacheForModel(const ModelId modelId);