- Extending Qt Creator Manual
- QtCreator
- IEditorFactory
- Extending Qt Creator Manual 10.0.0-rc1

# 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

- List of all members, including inherited members

## 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

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