Struct TextEdit

Multiline text editing control.

struct TextEdit ;

TextEdit is meant for editing large, multiline text. It also has facilities for editing code, such as syntax highlighting support and multiple levels of undo/redo.

Properties

NameTypeDescription
breakpointGutter[get, set] boolIf true, the breakpoint gutter is visible.
caretBlink[get, set] boolIf true, the caret (visual cursor) blinks.
caretBlinkSpeed[get, set] doubleDuration (in seconds) of a caret's blinking cycle.
caretBlockMode[get, set] boolIf true, the caret displays as a rectangle. If false, the caret displays as a bar.
caretMovingByRightClick[get, set] boolIf true, a right-click moves the cursor at the mouse position before displaying the context menu. If false, the context menu disregards mouse location.
contextMenuEnabled[get, set] boolIf true, a right-click displays the context menu.
drawSpaces[get, set] boolIf true, the "space" character will have a visible representation.
drawTabs[get, set] boolIf true, the "tab" character will have a visible representation.
foldGutter[get, set] boolIf true, the fold gutter is visible. This enables folding groups of indented lines.
hidingEnabled[get, set] boolIf true, all lines that have been set to hidden by setLineAsHidden, will not be visible.
highlightAllOccurrences[get, set] boolIf true, all occurrences of the selected text will be highlighted.
highlightCurrentLine[get, set] boolIf true, the line containing the cursor is highlighted.
minimapDraw[get, set] bool
minimapWidth[get, set] long
overrideSelectedFontColor[get, set] bool
readonly[get, set] boolIf true, read-only mode is enabled. Existing text cannot be modified and new text cannot be added.
scrollHorizontal[get, set] longThe current horizontal scroll value.
scrollVertical[get, set] doubleThe current vertical scroll value.
selectingEnabled[get, set] bool
shortcutKeysEnabled[get, set] bool
showLineNumbers[get, set] boolIf true, line numbers are displayed to the left of the text.
smoothScrolling[get, set] boolIf true, sets the step of the scrollbars to 0.25 which results in smoother scrolling.
syntaxHighlighting[get, set] boolIf true, any custom color properties that have been set for this TextEdit will be visible.
text[get, set] StringString value of the TextEdit.
vScrollSpeed[get, set] doubleVertical scroll sensitivity.
wrapEnabled[get, set] boolIf true, enables text wrapping when it goes beyond the edge of what is visible.

Methods

NameDescription
_clickSelectionHeld
_cursorChangedEmit
_guiInput
_pushCurrentOp
_scrollMoved
_textChangedEmit
_toggleDrawCaret
_updateWrapAt
_vScrollInput
addColorRegion Adds color region (given the delimiters) and its colors.
addKeywordColor Adds a keyword and its Color.
canFold Returns if the given line is foldable, that is, it has indented lines right below it.
centerViewportToCursor
clearColors Clears all custom syntax coloring information previously added with addColorRegion or addKeywordColor.
clearUndoHistory Clears the undo history.
copy Copy's the current text selection.
cursorGetBlinkEnabled
cursorGetBlinkSpeed
cursorGetColumn Returns the column the editing cursor is at.
cursorGetLine Returns the line the editing cursor is at.
cursorIsBlockMode
cursorSetBlinkEnabled
cursorSetBlinkSpeed
cursorSetBlockMode
cursorSetColumn Moves the cursor at the specified column index. If adjust_viewport is set to true, the viewport will center at the cursor position after the move occurs.
cursorSetLine Moves the cursor at the specified line index. If adjust_viewport is set to true, the viewport will center at the cursor position after the move occurs. If can_be_hidden is set to true, the specified line can be hidden using setLineAsHidden.
cut Cut's the current selection.
deselect Deselects the current selection.
drawMinimap
foldAllLines Folds all lines that are possible to be folded (see canFold).
foldLine Folds the given line, if possible (see canFold).
getBreakpoints Returns an array containing the line number of each breakpoint.
getHScroll
getKeywordColor Returns the Color of the specified keyword.
getLine Returns the text of a specific line.
getLineCount Returns the amount of total lines in the text.
getMenu Returns the PopupMenu of this TextEdit. By default, this menu is displayed when right-clicking on the TextEdit.
getMinimapWidth
getSelectionFromColumn Returns the selection begin column.
getSelectionFromLine Returns the selection begin line.
getSelectionText Returns the text inside the selection.
getSelectionToColumn Returns the selection end column.
getSelectionToLine Returns the selection end line.
getText
getVScroll
getVScrollSpeed
getWordUnderCursor Returns a String text with the word under the mouse cursor location.
hasKeywordColor Returns whether the specified keyword has a color set to it or not.
insertTextAtCursor Insert the specified text at the cursor position.
isBreakpointGutterEnabled
isContextMenuEnabled
isDrawingFoldGutter
isDrawingMinimap
isDrawingSpaces
isDrawingTabs
isFolded Returns whether the line at the specified index is folded or not.
isHidingEnabled
isHighlightAllOccurrencesEnabled
isHighlightCurrentLineEnabled
isLineHidden Returns whether the line at the specified index is hidden or not.
isOverridingSelectedFontColor
isReadonly
isRightClickMovingCaret
isSelectingEnabled
isSelectionActive Returns true if the selection is active.
isShortcutKeysEnabled
isShowLineNumbersEnabled
isSmoothScrollEnabled
isSyntaxColoringEnabled
isWrapEnabled
menuOption Triggers a right-click menu action by the specified index. See menuitems for a list of available indexes.
paste Paste the current selection.
redo Perform redo operation.
removeBreakpoints Removes all the breakpoints. This will not fire the breakpointToggled signal.
search Perform a search inside the text. Search flags can be specified in the searchflags enum. Returns an empty PoolIntArray if no result was found. Otherwise, the result line and column can be accessed at indices specified in the searchresult enum, e.g:
select Perform selection, from line/column to line/column.
selectAll Select all the text.
setBreakpointGutterEnabled
setContextMenuEnabled
setDrawFoldGutter
setDrawSpaces
setDrawTabs
setHidingEnabled
setHighlightAllOccurrences
setHighlightCurrentLine
setHScroll
setLineAsHidden If true, hides the line of the specified index.
setMinimapWidth
setOverrideSelectedFontColor
setReadonly
setRightClickMovesCaret
setSelectingEnabled
setShortcutKeysEnabled
setShowLineNumbers
setSmoothScrollEnable
setSyntaxColoring
setText
setVScroll
setVScrollSpeed
setWrapEnabled
toggleFoldLine Toggle the folding of the code block at the given line.
undo Perform undo operation.
unfoldLine Unfolds the given line, if folded.
unhideAllLines Unhide all lines that were previously set to hidden by setLineAsHidden.

Enums

NameDescription
Constants
MenuItems
SearchFlags
SearchResult