IEditorFactory Class
class Core::IEditorFactoryThe IEditorFactory class creates suitable editors for documents according to their MIME type. More...
Header: | #include <coreplugin/editormanager/ieditorfactory.h> |
Inherits: | Core::EditorType |
Public Functions
IEditorFactory() | |
Core::IEditor * | createEditor() const |
Static Public Members
const Core::EditorFactoryList | preferredEditorFactories(const Utils::FilePath &filePath) |
Protected Functions
void | setEditorCreator(const std::function<IEditor *()> &creator) |
Detailed Description
Whenever a user wants to edit or create a document, the EditorManager scans all IEditorFactory instances for suitable editors. The selected IEditorFactory is then asked to create an editor.
Implementations should set the properties of the IEditorFactory subclass in their constructor with EditorType::setId(), EditorType::setDisplayName(), EditorType::setMimeTypes(), and setEditorCreator()
IEditorFactory instances automatically register themselves in Qt Creator in their constructor.
See also Core::EditorType, Core::IEditor, Core::IDocument, and Core::EditorManager.
Member Function Documentation
IEditorFactory::IEditorFactory()
Creates an IEditorFactory.
Registers the IEditorFactory in Qt Creator.
Core::IEditor *IEditorFactory::createEditor() const
Creates an editor.
Uses the function set with setEditorCreator() to create the editor.
See also setEditorCreator().
[static]
const Core::EditorFactoryList IEditorFactory::preferredEditorFactories(const Utils::FilePath &filePath)
Returns the available editor factories for filePath in order of preference. That is the default order for the document's MIME type but with a user overridden default editor first, and the binary editor as the very first item if a text document is too large to be opened as a text file.
[protected]
void IEditorFactory::setEditorCreator(const std::function<IEditor *()> &creator)
Sets the function that is used to create an editor instance in createEditor() to creator.
See also createEditor().
© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.