IEditorFactory Class

class Core::IEditorFactory

The 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()
IEditor *createEditor() const

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.

IEditor *IEditorFactory::createEditor() const

Creates an editor.

Uses the function set with setEditorCreator() to create the editor.

See also setEditorCreator().

[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().