Extending Qt Creator Manual | ModelManagerInterface

Extending Qt Creator Manual 4.7.2

# ModelManagerInterface Class

(QmlJS::ModelManagerInterface)

The ModelManagerInterface class acts as an interface to the global state of the QmlJS code model. More...

Header: | #include <ModelManagerInterface>
Inherits: | QObject

- List of all members, including inherited members

## Public Types

class | CppData
class | ProjectInfo
class | WorkingCopy
typedef | CppDataHash
typedef | CppDataHashIterator
enum | QrcResourceSelector { ActiveQrcResources, AllQrcResources }

## Public Functions

| ModelManagerInterface(QObject *parent = 0)
virtual | ~ModelManagerInterface() override
void | activateScan()
QmlJS::QmlLanguageBundles | activeBundles() const
QList<QmlJS::ModelManagerInterface::ProjectInfo> | allProjectInfosForPath(const QString &path) const
QmlJS::LibraryInfo | builtins(const Document::Ptr &doc) const
QmlJS::ViewerContext | completeVContext(const QmlJS::ViewerContext &vCtx, const Document::Ptr &doc = Document::Ptr(0)) const
QmlJS::ModelManagerInterface::CppDataHash | cppData() const
virtual QmlJS::ModelManagerInterface::ProjectInfo | defaultProjectInfo() const
virtual QmlJS::ModelManagerInterface::ProjectInfo | defaultProjectInfoForProject(ProjectExplorer::Project *project) const
QmlJS::ViewerContext | defaultVContext(int language = ..., const Document::Ptr &doc = Document::Ptr(0), bool autoComplete = true) const
void | emitDocumentChangedOnDisk(QmlJS::Document::Ptr doc)
QmlJS::Document::Ptr | ensuredGetDocumentForPath(const QString &filePath)
QmlJS::QmlLanguageBundles | extendedBundles() const
void | fileChangedOnDisk(const QString &path)
QStringList | filesAtQrcPath(const QString &path, const QLocale *locale = 0, ProjectExplorer::Project *project = 0, QmlJS::ModelManagerInterface::QrcResourceSelector resources = AllQrcResources)
QMap<QString, QStringList> | filesInQrcPath(const QString &path, const QLocale *locale = 0, ProjectExplorer::Project *project = 0, bool addDirs = false, QmlJS::ModelManagerInterface::QrcResourceSelector resources = AllQrcResources)
QStringList | importPathsNames() const
bool | isIdle() const
void | joinAllThreads()
void | loadPluginTypes(const QString &libraryPath, const QString &importPath, const QString &importUri, const QString &importVersion)
void | maybeQueueCppQmlTypeUpdate(const int &doc)
QmlJS::Snapshot | newestSnapshot() const
QmlJS::ModelManagerInterface::ProjectInfo | projectInfo(ProjectExplorer::Project *project, const ModelManagerInterface::ProjectInfo &defaultValue = ProjectInfo()) const
QmlJS::ModelManagerInterface::ProjectInfo | projectInfoForPath(const QString &path) const
QList<QmlJS::ModelManagerInterface::ProjectInfo> | projectInfos() const
QStringList | qrcPathsForFile(const QString &file, const QLocale *locale = 0, ProjectExplorer::Project *project = 0, QmlJS::ModelManagerInterface::QrcResourceSelector resources = AllQrcResources)
void | removeFiles(const QStringList &files)
void | removeProjectInfo(ProjectExplorer::Project *project)
virtual void | resetCodeModel()
void | setDefaultVContext(const QmlJS::ViewerContext &vContext)
QmlJS::Snapshot | snapshot() const
void | updateDocument(QmlJS::Document::Ptr doc)
void | updateLibraryInfo(const QString &path, const QmlJS::LibraryInfo &info)
void | updateProjectInfo(const QmlJS::ModelManagerInterface::ProjectInfo &pinfo, ProjectExplorer::Project *p)
void | updateQrcFile(const QString &path)
void | updateSourceFiles(const QStringList &files, bool emitDocumentOnDiskChanged)

- 34 public functions inherited from QObject

## Static Public Members

QStringList | globPatternsForLanguages(const int languages)
int | guessLanguageOfFile(const QString &)
void | importScan(int &future, QmlJS::ModelManagerInterface::WorkingCopy workingCopyInternal, int paths, QmlJS::ModelManagerInterface *modelManager, bool emitDocChangedOnDisk, bool libOnly = true, bool forceRescan = false)
QmlJS::ModelManagerInterface * | instance()
QmlJS::ModelManagerInterface::WorkingCopy | workingCopy()
void | writeWarning(const QString &msg)

- 10 static public members inherited from QObject

## Protected Functions

void | aboutToRemoveFiles(const QStringList &files)
virtual void | addTaskInternal(int result, const QString &msg, const char *taskId) const
void | asyncReset()
void | documentChangedOnDisk(QmlJS::Document::Ptr doc)
void | documentUpdated(QmlJS::Document::Ptr doc)
int | languageForSuffix() const
void | libraryInfoUpdated(const QString &path, const QmlJS::LibraryInfo &info)
void | loadQmlTypeDescriptionsInternal(const QString &path)
void | maybeScan(const int &importPaths)
int * | mutex() const
void | projectInfoUpdated(const QmlJS::ModelManagerInterface::ProjectInfo &pinfo)
void | projectPathChanged(const QString &projectPath)
void | queueCppQmlTypeUpdate(const int &doc, bool scan)
int | refreshSourceFiles(const QStringList &, bool)
void | setDefaultProject(const QmlJS::ModelManagerInterface::ProjectInfo &pInfo, ProjectExplorer::Project *p)
virtual void | startCppQmlTypeUpdate()
void | updateImportPaths()
virtual QmlJS::ModelManagerInterface::WorkingCopy | workingCopyInternal() const
virtual void | writeMessageInternal(const QString &msg) const

- 9 protected functions inherited from QObject

## Static Protected Members

void | parse(int &future, QmlJS::ModelManagerInterface::WorkingCopy workingCopyInternal, QStringList files, QmlJS::ModelManagerInterface *modelManager, int mainLanguage, bool emitDocChangedOnDisk)
void | parseLoop(QSet<QString> &scannedPaths, QSet<QString> &newLibraries, QmlJS::ModelManagerInterface::WorkingCopy workingCopyInternal, QStringList files, QmlJS::ModelManagerInterface *modelManager, int mainLanguage, bool emitDocChangedOnDisk, int reportProgress)
void | updateCppQmlTypes(int &futureInterface, QmlJS::ModelManagerInterface *qmlModelManager, CPlusPlus::Snapshot snapshot, int documents)

### Additional Inherited Members

- 1 property inherited from QObject
- 1 public slot inherited from QObject
- 2 signals inherited from QObject
- 1 public variable inherited from QObject
- 2 protected variables inherited from QObject

## Detailed Description

The ModelManagerInterface class acts as an interface to the global state of the QmlJS code model.

The ModelManagerInterface is an interface for global state and actions in the QmlJS code model. It is implemented by QmlJSTools::Internal::ModelManager and the instance can be accessed through ModelManagerInterface::instance().

One of its primary concerns is to keep the Snapshots it maintains up to date by parsing documents and finding QML modules.

It has a Snapshot that contains only valid Documents, accessible through ModelManagerInterface::snapshot() and a Snapshot with potentially more recent, but invalid documents that is exposed through ModelManagerInterface::newestSnapshot().

See also QmlJS::Document, QmlJS::Snapshot, and QmlJSTools::Internal::ModelManager.

## Member Type Documentation

### typedef ModelManagerInterface::CppDataHash

### typedef ModelManagerInterface::CppDataHashIterator

### enum ModelManagerInterface::QrcResourceSelector

## Member Function Documentation

### ModelManagerInterface::ModelManagerInterface(QObject *parent = 0)

Default constructs an instance of ModelManagerInterface.

### `[override virtual]` ModelManagerInterface::~ModelManagerInterface()

Destroys the instance of ModelManagerInterface. The destructor is virtual.

### `[protected]` void ModelManagerInterface::aboutToRemoveFiles(const QStringList &files)

### void ModelManagerInterface::activateScan()

### QmlJS::QmlLanguageBundles ModelManagerInterface::activeBundles() const

### `[virtual protected]` void ModelManagerInterface::addTaskInternal(int result, const QString &msg, const char *taskId) const

### QList<QmlJS::ModelManagerInterface::ProjectInfo> ModelManagerInterface::allProjectInfosForPath(const QString &path) const

Returns list of project infos for path

### `[protected]` void ModelManagerInterface::asyncReset()

### QmlJS::LibraryInfo ModelManagerInterface::builtins(const Document::Ptr &doc) const

### QmlJS::ViewerContext ModelManagerInterface::completeVContext(const QmlJS::ViewerContext &vCtx, const Document::Ptr &doc = Document::Ptr(0)) const

### QmlJS::ModelManagerInterface::CppDataHash ModelManagerInterface::cppData() const

### `[virtual]` QmlJS::ModelManagerInterface::ProjectInfo ModelManagerInterface::defaultProjectInfo() const

### `[virtual]` QmlJS::ModelManagerInterface::ProjectInfo ModelManagerInterface::defaultProjectInfoForProject(ProjectExplorer::Project *project) const

### QmlJS::ViewerContext ModelManagerInterface::defaultVContext(int language = ..., const Document::Ptr &doc = Document::Ptr(0), bool autoComplete = true) const

See also setDefaultVContext().

### `[protected]` void ModelManagerInterface::documentChangedOnDisk(QmlJS::Document::Ptr doc)

### `[protected]` void ModelManagerInterface::documentUpdated(QmlJS::Document::Ptr doc)

### void ModelManagerInterface::emitDocumentChangedOnDisk(QmlJS::Document::Ptr doc)

### QmlJS::Document::Ptr ModelManagerInterface::ensuredGetDocumentForPath(const QString &filePath)

### QmlJS::QmlLanguageBundles ModelManagerInterface::extendedBundles() const

### void ModelManagerInterface::fileChangedOnDisk(const QString &path)

### QStringList ModelManagerInterface::filesAtQrcPath(const QString &path, const QLocale *locale = 0, ProjectExplorer::Project *project = 0, QmlJS::ModelManagerInterface::QrcResourceSelector resources = AllQrcResources)

### QMap<QString, QStringList> ModelManagerInterface::filesInQrcPath(const QString &path, const QLocale *locale = 0, ProjectExplorer::Project *project = 0, bool addDirs = false, QmlJS::ModelManagerInterface::QrcResourceSelector resources = AllQrcResources)

### `[static]` QStringList ModelManagerInterface::globPatternsForLanguages(const int languages)

### `[static]` int ModelManagerInterface::guessLanguageOfFile(const QString &)

### QStringList ModelManagerInterface::importPathsNames() const

### `[static]` void ModelManagerInterface::importScan(int &future, QmlJS::ModelManagerInterface::WorkingCopy workingCopyInternal, int paths, QmlJS::ModelManagerInterface *modelManager, bool emitDocChangedOnDisk, bool libOnly = true, bool forceRescan = false)

### `[static]` QmlJS::ModelManagerInterface *ModelManagerInterface::instance()

### bool ModelManagerInterface::isIdle() const

### void ModelManagerInterface::joinAllThreads()

### `[protected]` int ModelManagerInterface::languageForSuffix() const

### `[protected]` void ModelManagerInterface::libraryInfoUpdated(const QString &path, const QmlJS::LibraryInfo &info)

### void ModelManagerInterface::loadPluginTypes(const QString &libraryPath, const QString &importPath, const QString &importUri, const QString &importVersion)

### `[protected]` void ModelManagerInterface::loadQmlTypeDescriptionsInternal(const QString &path)

### void ModelManagerInterface::maybeQueueCppQmlTypeUpdate(const int &doc)

### `[protected]` void ModelManagerInterface::maybeScan(const int &importPaths)

### `[protected]` int *ModelManagerInterface::mutex() const

### QmlJS::Snapshot ModelManagerInterface::newestSnapshot() const

### `[static protected]` void ModelManagerInterface::parse(int &future, QmlJS::ModelManagerInterface::WorkingCopy workingCopyInternal, QStringList files, QmlJS::ModelManagerInterface *modelManager, int mainLanguage, bool emitDocChangedOnDisk)

### `[static protected]` void ModelManagerInterface::parseLoop(QSet<QString> &scannedPaths, QSet<QString> &newLibraries, QmlJS::ModelManagerInterface::WorkingCopy workingCopyInternal, QStringList files, QmlJS::ModelManagerInterface *modelManager, int mainLanguage, bool emitDocChangedOnDisk, int reportProgress)

### QmlJS::ModelManagerInterface::ProjectInfo ModelManagerInterface::projectInfo(ProjectExplorer::Project *project, const ModelManagerInterface::ProjectInfo &defaultValue = ProjectInfo()) const

### QmlJS::ModelManagerInterface::ProjectInfo ModelManagerInterface::projectInfoForPath(const QString &path) const

Returns project info with summarized info for path

Note: Project pointer will be empty

### `[protected]` void ModelManagerInterface::projectInfoUpdated(const QmlJS::ModelManagerInterface::ProjectInfo &pinfo)

### QList<QmlJS::ModelManagerInterface::ProjectInfo> ModelManagerInterface::projectInfos() const

### `[protected]` void ModelManagerInterface::projectPathChanged(const QString &projectPath)

### QStringList ModelManagerInterface::qrcPathsForFile(const QString &file, const QLocale *locale = 0, ProjectExplorer::Project *project = 0, QmlJS::ModelManagerInterface::QrcResourceSelector resources = AllQrcResources)

### `[protected]` void ModelManagerInterface::queueCppQmlTypeUpdate(const int &doc, bool scan)

### `[protected]` int ModelManagerInterface::refreshSourceFiles(const QStringList &, bool)

### void ModelManagerInterface::removeFiles(const QStringList &files)

### void ModelManagerInterface::removeProjectInfo(ProjectExplorer::Project *project)

### `[virtual]` void ModelManagerInterface::resetCodeModel()

### `[protected]` void ModelManagerInterface::setDefaultProject(const QmlJS::ModelManagerInterface::ProjectInfo &pInfo, ProjectExplorer::Project *p)

### void ModelManagerInterface::setDefaultVContext(const QmlJS::ViewerContext &vContext)

See also defaultVContext().

### QmlJS::Snapshot ModelManagerInterface::snapshot() const

### `[virtual protected]` void ModelManagerInterface::startCppQmlTypeUpdate()

### `[static protected]` void ModelManagerInterface::updateCppQmlTypes(int &futureInterface, QmlJS::ModelManagerInterface *qmlModelManager, CPlusPlus::Snapshot snapshot, int documents)

### void ModelManagerInterface::updateDocument(QmlJS::Document::Ptr doc)

### `[protected]` void ModelManagerInterface::updateImportPaths()

### void ModelManagerInterface::updateLibraryInfo(const QString &path, const QmlJS::LibraryInfo &info)

### void ModelManagerInterface::updateProjectInfo(const QmlJS::ModelManagerInterface::ProjectInfo &pinfo, ProjectExplorer::Project *p)

### void ModelManagerInterface::updateQrcFile(const QString &path)

### void ModelManagerInterface::updateSourceFiles(const QStringList &files, bool emitDocumentOnDiskChanged)

### `[static]` QmlJS::ModelManagerInterface::WorkingCopy ModelManagerInterface::workingCopy()

### `[virtual protected]` QmlJS::ModelManagerInterface::WorkingCopy ModelManagerInterface::workingCopyInternal() const

### `[virtual protected]` void ModelManagerInterface::writeMessageInternal(const QString &msg) const

### `[static]` void ModelManagerInterface::writeWarning(const QString &msg)