Extending Qt Creator Manual | EditorManager

Extending Qt Creator Manual 4.5.2

# EditorManager Class

(Core::EditorManager)

- List of all members, including inherited members

## Public Types

class | FilePathInfo
typedef | EditorFactoryList
typedef | ExternalEditorList
enum | OpenEditorFlag { NoFlags, DoNotChangeCurrentEditor, IgnoreNavigationHistory, DoNotMakeVisible, ..., DoNotSwitchToEditMode }
flags | OpenEditorFlags
typedef | WindowTitleHandler

## Public Slots

bool | closeAllEditors(bool askAboutModifiedEditors = true)
void | closeOtherDocuments()
void | goBackInNavigationHistory()
void | goForwardInNavigationHistory()
void | gotoOtherSplit()
void | revertToSaved()
void | saveDocument()
void | saveDocumentAs()
void | slotCloseCurrentEditorOrDocument()
void | splitSideBySide()
void | updateWindowTitles()

## Signals

void | aboutToSave(IDocument *document)
void | autoSaved()
void | currentDocumentStateChanged()
void | currentEditorAboutToChange(Core::IEditor *editor)
void | currentEditorChanged(Core::IEditor *editor)
void | documentStateChanged(Core::IDocument *document)
void | editorAboutToClose(Core::IEditor *editor)
void | editorCreated(Core::IEditor *editor, const QString &fileName)
void | editorOpened(Core::IEditor *editor)
void | editorsClosed(QList<Core::IEditor *> editors)
void | findOnFileSystemRequest(const QString &path)

## Static Public Members

void | activateEditor(IEditor *editor, OpenEditorFlags flags = 0)
IEditor * | activateEditorForDocument(IDocument *document, OpenEditorFlags flags = 0)
void | activateEditorForEntry(DocumentModel::Entry *entry, OpenEditorFlags flags = 0)
void | addCloseEditorListener(const std::function<bool( IEditor * ) > &listener)
void | addCurrentPositionToNavigationHistory(const QByteArray &saveState = QByteArray())
void | addNativeDirAndOpenWithActions(QMenu *contextMenu, DocumentModel::Entry *entry)
void | addSaveAndCloseEditorActions(QMenu *contextMenu, DocumentModel::Entry *entry, IEditor *editor = 0)
void | clearUniqueId(IDocument *document)
bool | closeDocument(IDocument *document, bool askAboutModifiedEditors = true)
void | closeDocument(DocumentModel::Entry *entry)
bool | closeDocuments(const QList<IDocument *> &documents, bool askAboutModifiedEditors = true)
void | closeEditor(IEditor *editor, bool askAboutModifiedEditors = true)
bool | closeEditors(const QList<IEditor *> &editorsToClose, bool askAboutModifiedEditors = true)
void | closeOtherDocuments(IDocument *document)
IDocument * | currentDocument()
IEditor * | currentEditor()
void | cutForwardNavigationHistory()
QTextCodec * | defaultTextCodec()
EditorFactoryList | editorFactories(const Utils::MimeType &mimeType, bool bestMatchOnly = true)
ExternalEditorList | externalEditors(const Utils::MimeType &mimeType, bool bestMatchOnly = true)
QStringList | getOpenFileNames()
bool | hasSplitter()
void | hideEditorStatusBar(const QString &id)
EditorManager * | instance()
bool | isAutoSaveFile(const QString &fileName)
qint64 | maxTextFileSize()
IEditor * | openEditor(const QString &fileName, Id editorId = Id(), OpenEditorFlags flags = NoFlags, bool *newEditor = 0)
IEditor * | openEditorAt(const QString &fileName, int line, int column = 0, Id editorId = Id(), OpenEditorFlags flags = NoFlags, bool *newEditor = 0)
void | openEditorAtSearchResult(const SearchResultItem &item, OpenEditorFlags flags = NoFlags)
IEditor * | openEditorWithContents(Id editorId, QString *titlePattern = 0, const QByteArray &contents = QByteArray(), const QString &uniqueId = QString(), OpenEditorFlags flags = NoFlags)
bool | openExternalEditor(const QString &fileName, Id editorId)
void | populateOpenWithMenu(QMenu *menu, const QString &fileName)
IDocument::ReloadSetting | reloadSetting()
bool | restoreState(const QByteArray &state)
bool | saveDocument(IDocument *document)
QByteArray | saveState()
void | setReloadSetting(IDocument::ReloadSetting behavior)
void | setSessionTitleHandler(WindowTitleHandler handler)
void | setWindowTitleAdditionHandler(WindowTitleHandler handler)
void | setWindowTitleVcsTopicHandler(WindowTitleHandler handler)
void | showEditorStatusBar(const QString &id, const QString &infoText, const QString &buttonText = QString(), QObject *object = nullptr, const std::function<void() > &function = nullptr)
bool | skipOpeningBigTextFile(const QString &filePath)
FilePathInfo | splitLineAndColumnNumber(const QString &filePath)
QList<IEditor *> | visibleEditors()

## Member Type Documentation

### typedef EditorManager::EditorFactoryList

### typedef EditorManager::ExternalEditorList

### enum EditorManager::OpenEditorFlag
flags EditorManager::OpenEditorFlags

The OpenEditorFlags type is a typedef for QFlags<OpenEditorFlag>. It stores an OR combination of OpenEditorFlag values.

### typedef EditorManager::WindowTitleHandler

## Member Function Documentation

### `[signal]` void EditorManager::aboutToSave(IDocument *document)

### `[static]` void EditorManager::activateEditor(IEditor *editor, OpenEditorFlags flags = 0)

### `[static]` IEditor *EditorManager::activateEditorForDocument(IDocument *document, OpenEditorFlags flags = 0)

### `[static]` void EditorManager::activateEditorForEntry(DocumentModel::Entry *entry, OpenEditorFlags flags = 0)

### `[static]` void EditorManager::addCloseEditorListener(const std::function<bool( IEditor * ) > &listener)

### `[static]` void EditorManager::addCurrentPositionToNavigationHistory(const QByteArray &saveState = QByteArray())

### `[static]` void EditorManager::addNativeDirAndOpenWithActions(QMenu *contextMenu, DocumentModel::Entry *entry)

### `[static]` void EditorManager::addSaveAndCloseEditorActions(QMenu *contextMenu, DocumentModel::Entry *entry, IEditor *editor = 0)

### `[signal]` void EditorManager::autoSaved()

### `[static]` void EditorManager::clearUniqueId(IDocument *document)

### `[static slot]` bool EditorManager::closeAllEditors(bool askAboutModifiedEditors = true)

### `[static]` bool EditorManager::closeDocument(IDocument *document, bool askAboutModifiedEditors = true)

### `[static]` void EditorManager::closeDocument(DocumentModel::Entry *entry)

### `[static]` bool EditorManager::closeDocuments(const QList<IDocument *> &documents, bool askAboutModifiedEditors = true)

### `[static]` void EditorManager::closeEditor(IEditor *editor, bool askAboutModifiedEditors = true)

### `[static]` bool EditorManager::closeEditors(const QList<IEditor *> &editorsToClose, bool askAboutModifiedEditors = true)

### `[static]` void EditorManager::closeOtherDocuments(IDocument *document)

### `[static slot]` void EditorManager::closeOtherDocuments()

### `[static]` IDocument *EditorManager::currentDocument()

### `[signal]` void EditorManager::currentDocumentStateChanged()

### `[static]` IEditor *EditorManager::currentEditor()

### `[signal]` void EditorManager::currentEditorAboutToChange(Core::IEditor *editor)

### `[signal]` void EditorManager::currentEditorChanged(Core::IEditor *editor)

### `[static]` void EditorManager::cutForwardNavigationHistory()

### `[static]` QTextCodec *EditorManager::defaultTextCodec()

### `[signal]` void EditorManager::documentStateChanged(Core::IDocument *document)

### `[signal]` void EditorManager::editorAboutToClose(Core::IEditor *editor)

### `[signal]` void EditorManager::editorCreated(Core::IEditor *editor, const QString &fileName)

### `[static]` EditorFactoryList EditorManager::editorFactories(const Utils::MimeType &mimeType, bool bestMatchOnly = true)

### `[signal]` void EditorManager::editorOpened(Core::IEditor *editor)

### `[signal]` void EditorManager::editorsClosed(QList<Core::IEditor *> editors)

### `[static]` ExternalEditorList EditorManager::externalEditors(const Utils::MimeType &mimeType, bool bestMatchOnly = true)

### `[signal]` void EditorManager::findOnFileSystemRequest(const QString &path)

### `[static]` QStringList EditorManager::getOpenFileNames()

### `[static slot]` void EditorManager::goBackInNavigationHistory()

### `[static slot]` void EditorManager::goForwardInNavigationHistory()

### `[static slot]` void EditorManager::gotoOtherSplit()

Moves focus to "other" split, possibly creating a split if necessary. If there's no split and no other window, a side-by-side split is created. If the current window is split, focus is moved to the next split within this window, cycling. If the current window is not split, focus is moved to the next window.

### `[static]` bool EditorManager::hasSplitter()

### `[static]` void EditorManager::hideEditorStatusBar(const QString &id)

### `[static]` EditorManager *EditorManager::instance()

### `[static]` bool EditorManager::isAutoSaveFile(const QString &fileName)

### `[static]` qint64 EditorManager::maxTextFileSize()

### `[static]` IEditor *EditorManager::openEditor(const QString &fileName, Id editorId = Id(), OpenEditorFlags flags = NoFlags, bool *newEditor = 0)

### `[static]` IEditor *EditorManager::openEditorAt(const QString &fileName, int line, int column = 0, Id editorId = Id(), OpenEditorFlags flags = NoFlags, bool *newEditor = 0)

### `[static]` void EditorManager::openEditorAtSearchResult(const SearchResultItem &item, OpenEditorFlags flags = NoFlags)

### `[static]` IEditor *EditorManager::openEditorWithContents(Id editorId, QString *titlePattern = 0, const QByteArray &contents = QByteArray(), const QString &uniqueId = QString(), OpenEditorFlags flags = NoFlags)

### `[static]` bool EditorManager::openExternalEditor(const QString &fileName, Id editorId)

### `[static]` void EditorManager::populateOpenWithMenu(QMenu *menu, const QString &fileName)

### `[static]` IDocument::ReloadSetting EditorManager::reloadSetting()

See also setReloadSetting().

### `[static]` bool EditorManager::restoreState(const QByteArray &state)

### `[static slot]` void EditorManager::revertToSaved()

### `[static]` bool EditorManager::saveDocument(IDocument *document)

### `[static slot]` void EditorManager::saveDocument()

### `[static slot]` void EditorManager::saveDocumentAs()

### `[static]` QByteArray EditorManager::saveState()

### `[static]` void EditorManager::setReloadSetting(IDocument::ReloadSetting behavior)

See also reloadSetting().

### `[static]` void EditorManager::setSessionTitleHandler(WindowTitleHandler handler)

### `[static]` void EditorManager::setWindowTitleAdditionHandler(WindowTitleHandler handler)

### `[static]` void EditorManager::setWindowTitleVcsTopicHandler(WindowTitleHandler handler)

### `[static]` void EditorManager::showEditorStatusBar(const QString &id, const QString &infoText, const QString &buttonText = QString(), QObject *object = nullptr, const std::function<void() > &function = nullptr)

### `[static]` bool EditorManager::skipOpeningBigTextFile(const QString &filePath)

### `[static slot]` void EditorManager::slotCloseCurrentEditorOrDocument()

### `[static]` FilePathInfo EditorManager::splitLineAndColumnNumber(const QString &filePath)

### `[static slot]` void EditorManager::splitSideBySide()

### `[static slot]` void EditorManager::updateWindowTitles()

### `[static]` QList<IEditor *> EditorManager::visibleEditors()