Extending Qt Creator Manual | BaseTextEditor

Extending Qt Creator Manual 4.6.0

# BaseTextEditor Class

(TextEditor::BaseTextEditor)

The BaseTextEditor class is base implementation for QPlainTextEdit-based text editors. It can use the Kate text highlighting definitions, and some basic auto indentation. More...

Header: | #include <BaseTextEditor>
Inherits: | Core::IEditor
Inherited By: | VcsBase::VcsBaseEditor

- List of all members, including inherited members

## Public Functions

| BaseTextEditor()
| ~BaseTextEditor()
void | addContext(Core::Id id)
QChar | characterAt(int pos) const
TextEditorWidget * | editorWidget() const
virtual void | finalizeInitialization()
virtual QString | selectedText() const
void | setTextCursor(const QTextCursor &cursor)
QString | textAt(int from, int to) const
QTextCursor | textCursor() const
TextDocument * | textDocument() const

## Reimplemented Public Functions

virtual void | contextHelpId(const HelpIdCallback &callback) const override
virtual int | currentColumn() const override
virtual int | currentLine() const override
virtual Core::IDocument * | document() override
virtual IEditor * | duplicate() override
virtual void | gotoLine(int line, int column = 0, bool centerLine = true) override
virtual bool | restoreState(const QByteArray &state) override
virtual QByteArray | saveState() const override
virtual void | setContextHelpId(const QString &id) override
virtual QWidget * | toolBar() override

- 11 public functions inherited from Core::IEditor
- 6 public functions inherited from Core::IContext

## Static Public Members

BaseTextEditor * | currentTextEditor()

## Detailed Description

The BaseTextEditor class is base implementation for QPlainTextEdit-based text editors. It can use the Kate text highlighting definitions, and some basic auto indentation.

The corresponding document base class is BaseTextDocument, the corresponding widget base class is BaseTextEditorWidget.

It is the default editor for text files used by Qt Creator, if no other editor implementation matches the MIME type.

## Member Function Documentation

### BaseTextEditor::BaseTextEditor()

Default constructs an instance of BaseTextEditor.

### BaseTextEditor::~BaseTextEditor()

Destroys the instance of BaseTextEditor.

### void BaseTextEditor::addContext(Core::Id id)

### QChar BaseTextEditor::characterAt(int pos) const

### `[override virtual]` void BaseTextEditor::contextHelpId(const HelpIdCallback &callback) const

See also setContextHelpId().

### `[override virtual]` int BaseTextEditor::currentColumn() const

### `[override virtual]` int BaseTextEditor::currentLine() const

### `[static]` BaseTextEditor *BaseTextEditor::currentTextEditor()

### `[override virtual]` Core::IDocument *BaseTextEditor::document()

### `[override virtual]` IEditor *BaseTextEditor::duplicate()

### TextEditorWidget *BaseTextEditor::editorWidget() const

### `[virtual]` void BaseTextEditor::finalizeInitialization()

### `[override virtual]` void BaseTextEditor::gotoLine(int line, int column = 0, bool centerLine = true)

### `[override virtual]` bool BaseTextEditor::restoreState(const QByteArray &state)

### `[override virtual]` QByteArray BaseTextEditor::saveState() const

### `[virtual]` QString BaseTextEditor::selectedText() const

### `[override virtual]` void BaseTextEditor::setContextHelpId(const QString &id)

See also contextHelpId().

### void BaseTextEditor::setTextCursor(const QTextCursor &cursor)

See also textCursor().

### QString BaseTextEditor::textAt(int from, int to) const

### QTextCursor BaseTextEditor::textCursor() const

See also setTextCursor().

### TextDocument *BaseTextEditor::textDocument() const

### `[override virtual]` QWidget *BaseTextEditor::toolBar()