Class, that describes code editor.
More...
#include <QCodeEditor.hpp>
|
void | focusInEvent (QFocusEvent *e) override |
| Method, that's called on focus into widget. It's required for setting this widget to set completer. More...
|
|
void | insertFromMimeData (const QMimeData *source) override |
| Method, that's called on any text insertion of mimedata into editor. If it's text - it inserts text as plain text. More...
|
|
void | keyPressEvent (QKeyEvent *e) override |
| Method, that's called on any key press, posted into code editor widget. This method is overloaded for: More...
|
|
void | paintEvent (QPaintEvent *e) override |
| Method, that's called on editor painting. This method if overloaded for line number area redraw. More...
|
|
void | resizeEvent (QResizeEvent *e) override |
| Method, that's called on any widget resize. This method if overloaded for line number area resizing. More...
|
|
Class, that describes code editor.
Definition at line 15 of file QCodeEditor.hpp.
◆ QCodeEditor() [1/2]
QCodeEditor::QCodeEditor |
( |
QWidget * |
widget = nullptr | ) |
|
|
explicit |
Constructor.
- Parameters
-
widget | Pointer to parent widget. |
Definition at line 31 of file QCodeEditor.cpp.
◆ QCodeEditor() [2/2]
◆ autoIndentation()
bool QCodeEditor::autoIndentation |
( |
| ) |
const |
Method for getting is auto indentation enabled. Default: true.
◆ autoParentheses()
bool QCodeEditor::autoParentheses |
( |
| ) |
const |
Method for getting is auto parentheses enabled. Default value: true.
◆ charUnderCursor()
QChar QCodeEditor::charUnderCursor |
( |
int |
offset = 0 | ) |
const |
|
private |
Method for getting character under cursor.
- Parameters
-
◆ completer()
QCompleter* QCodeEditor::completer |
( |
| ) |
const |
Method for getting completer.
- Returns
- Pointer to completer.
◆ focusInEvent()
void QCodeEditor::focusInEvent |
( |
QFocusEvent * |
e | ) |
|
|
overrideprotected |
Method, that's called on focus into widget. It's required for setting this widget to set completer.
◆ getFirstVisibleBlock()
int QCodeEditor::getFirstVisibleBlock |
( |
| ) |
|
Method for getting first visible block index.
- Returns
- Index.
Definition at line 378 of file QCodeEditor.cpp.
◆ getIndentationSpaces()
int QCodeEditor::getIndentationSpaces |
( |
| ) |
|
|
private |
Method for getting number of indentation spaces in current line. Tabs will be treated as tabWidth / spaceWidth
◆ handleSelectionQuery()
void QCodeEditor::handleSelectionQuery |
( |
QTextCursor |
cursor | ) |
|
|
private |
Method, that performs selection frame selection.
Definition at line 235 of file QCodeEditor.cpp.
◆ highlightCurrentLine()
void QCodeEditor::highlightCurrentLine |
( |
QList< QTextEdit::ExtraSelection > & |
extraSelection | ) |
|
|
private |
Method, that adds highlighting of currently selected line to extra selection list.
Definition at line 356 of file QCodeEditor.cpp.
◆ highlightParenthesis()
void QCodeEditor::highlightParenthesis |
( |
QList< QTextEdit::ExtraSelection > & |
extraSelection | ) |
|
|
private |
Method, that adds highlighting of parenthesis if available.
Definition at line 259 of file QCodeEditor.cpp.
◆ initDocumentLayoutHandlers()
void QCodeEditor::initDocumentLayoutHandlers |
( |
| ) |
|
|
private |
Method for initializing document layout handlers.
Definition at line 50 of file QCodeEditor.cpp.
◆ initFont()
void QCodeEditor::initFont |
( |
| ) |
|
|
private |
Method for initializing default monospace font.
Definition at line 60 of file QCodeEditor.cpp.
◆ insertCompletion
void QCodeEditor::insertCompletion |
( |
QString |
s | ) |
|
|
slot |
Slot, that performs insertion of completion info into code.
- Parameters
-
◆ insertFromMimeData()
void QCodeEditor::insertFromMimeData |
( |
const QMimeData * |
source | ) |
|
|
overrideprotected |
Method, that's called on any text insertion of mimedata into editor. If it's text - it inserts text as plain text.
◆ keyPressEvent()
void QCodeEditor::keyPressEvent |
( |
QKeyEvent * |
e | ) |
|
|
overrideprotected |
Method, that's called on any key press, posted into code editor widget. This method is overloaded for:
- Completion
- Tab to spaces
- Low indentation
- Auto parenthesis
◆ onSelectionChanged
void QCodeEditor::onSelectionChanged |
( |
| ) |
|
|
slot |
Slot, that will be called on selection change.
Definition at line 165 of file QCodeEditor.cpp.
◆ operator=()
◆ paintEvent()
void QCodeEditor::paintEvent |
( |
QPaintEvent * |
e | ) |
|
|
overrideprotected |
Method, that's called on editor painting. This method if overloaded for line number area redraw.
Definition at line 372 of file QCodeEditor.cpp.
◆ performConnections()
void QCodeEditor::performConnections |
( |
| ) |
|
|
private |
Method for performing connection of objects.
Definition at line 69 of file QCodeEditor.cpp.
◆ proceedCompleterBegin()
bool QCodeEditor::proceedCompleterBegin |
( |
QKeyEvent * |
e | ) |
|
|
private |
Method, that performs completer processing. Returns true if event has to be dropped.
- Parameters
-
- Returns
- Shall event be dropped.
Definition at line 412 of file QCodeEditor.cpp.
◆ proceedCompleterEnd()
void QCodeEditor::proceedCompleterEnd |
( |
QKeyEvent * |
e | ) |
|
|
private |
◆ resizeEvent()
void QCodeEditor::resizeEvent |
( |
QResizeEvent * |
e | ) |
|
|
overrideprotected |
Method, that's called on any widget resize. This method if overloaded for line number area resizing.
Definition at line 195 of file QCodeEditor.cpp.
◆ setAutoIndentation()
void QCodeEditor::setAutoIndentation |
( |
bool |
enabled | ) |
|
Method for setting auto indentation enabled.
◆ setAutoParentheses()
void QCodeEditor::setAutoParentheses |
( |
bool |
enabled | ) |
|
Method setting auto parentheses enabled.
◆ setCompleter()
void QCodeEditor::setCompleter |
( |
QCompleter * |
completer | ) |
|
Method for setting completer.
- Parameters
-
completer | Pointer to completer object. |
◆ setHighlighter()
Method for setting highlighter.
- Parameters
-
highlighter | Pointer to syntax highlighter. |
Definition at line 99 of file QCodeEditor.cpp.
◆ setSyntaxStyle()
Method for setting syntax sty.e.
- Parameters
-
style | Pointer to syntax style. |
Definition at line 115 of file QCodeEditor.cpp.
◆ setTabReplace()
void QCodeEditor::setTabReplace |
( |
bool |
enabled | ) |
|
Method for setting tab replacing enabled.
◆ setTabReplaceSize()
void QCodeEditor::setTabReplaceSize |
( |
int |
val | ) |
|
Method for setting amount of spaces, that will replace tab.
- Parameters
-
◆ tabReplace()
bool QCodeEditor::tabReplace |
( |
| ) |
const |
Method for getting is tab replacing enabled. Default value: true.
◆ tabReplaceSize()
int QCodeEditor::tabReplaceSize |
( |
| ) |
const |
Method for getting number of spaces, that will replace tab if tabReplace
is true. Default: 4.
◆ updateExtraSelection
void QCodeEditor::updateExtraSelection |
( |
| ) |
|
|
slot |
Slot, that will proceed extra selection for current cursor position.
Definition at line 249 of file QCodeEditor.cpp.
◆ updateLineGeometry()
void QCodeEditor::updateLineGeometry |
( |
| ) |
|
|
private |
Method for updating geometry of line number area.
Definition at line 202 of file QCodeEditor.cpp.
◆ updateLineNumberArea
void QCodeEditor::updateLineNumberArea |
( |
const QRect & |
rect | ) |
|
|
slot |
Slot, that performs update of some part of line number area.
- Parameters
-
rect | Area that has to be updated. |
Definition at line 219 of file QCodeEditor.cpp.
◆ updateLineNumberAreaWidth
void QCodeEditor::updateLineNumberAreaWidth |
( |
int |
| ) |
|
|
slot |
Slot, that performs update of internal editor viewport based on line number area width.
Definition at line 214 of file QCodeEditor.cpp.
◆ updateStyle
void QCodeEditor::updateStyle |
( |
| ) |
|
|
slot |
◆ wordUnderCursor()
QString QCodeEditor::wordUnderCursor |
( |
| ) |
const |
|
private |
Method for getting word under cursor.
- Returns
- Word under cursor.
◆ m_autoIndentation
bool QCodeEditor::m_autoIndentation |
|
private |
◆ m_autoParentheses
bool QCodeEditor::m_autoParentheses |
|
private |
◆ m_completer
QCompleter* QCodeEditor::m_completer |
|
private |
◆ m_framedAttribute
◆ m_highlighter
◆ m_lineNumberArea
◆ m_replaceTab
bool QCodeEditor::m_replaceTab |
|
private |
◆ m_syntaxStyle
◆ m_tabReplace
QString QCodeEditor::m_tabReplace |
|
private |
The documentation for this class was generated from the following files: