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
Name | Type | Description |
---|---|---|
breakpointGutter [get, set]
|
bool | If true , the breakpoint gutter is visible.
|
caretBlink [get, set]
|
bool | If true , the caret (visual cursor) blinks.
|
caretBlinkSpeed [get, set]
|
double | Duration (in seconds) of a caret's blinking cycle. |
caretBlockMode [get, set]
|
bool | If true , the caret displays as a rectangle.
If false , the caret displays as a bar.
|
caretMovingByRightClick [get, set]
|
bool | If 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]
|
bool | If true , a right-click displays the context menu.
|
drawSpaces [get, set]
|
bool | If true , the "space" character will have a visible representation.
|
drawTabs [get, set]
|
bool | If true , the "tab" character will have a visible representation.
|
foldGutter [get, set]
|
bool | If true , the fold gutter is visible. This enables folding groups of indented lines.
|
hidingEnabled [get, set]
|
bool | If true , all lines that have been set to hidden by setLineAsHidden , will not be visible.
|
highlightAllOccurrences [get, set]
|
bool | If true , all occurrences of the selected text will be highlighted.
|
highlightCurrentLine [get, set]
|
bool | If true , the line containing the cursor is highlighted.
|
minimapDraw [get, set]
|
bool | |
minimapWidth [get, set]
|
long | |
overrideSelectedFontColor [get, set]
|
bool | |
readonly [get, set]
|
bool | If true , read-only mode is enabled. Existing text cannot be modified and new text cannot be added.
|
scrollHorizontal [get, set]
|
long | The current horizontal scroll value. |
scrollVertical [get, set]
|
double | The current vertical scroll value. |
selectingEnabled [get, set]
|
bool | |
shortcutKeysEnabled [get, set]
|
bool | |
showLineNumbers [get, set]
|
bool | If true , line numbers are displayed to the left of the text.
|
smoothScrolling [get, set]
|
bool | If true , sets the step of the scrollbars to 0.25 which results in smoother scrolling.
|
syntaxHighlighting [get, set]
|
bool | If true , any custom color properties that have been set for this TextEdit will be visible.
|
text [get, set]
|
String | String value of the TextEdit .
|
vScrollSpeed [get, set]
|
double | Vertical scroll sensitivity. |
wrapEnabled [get, set]
|
bool | If true , enables text wrapping when it goes beyond the edge of what is visible.
|
Methods
Name | Description |
---|---|
_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
Name | Description |
---|---|
Constants
|
|
MenuItems
|
|
SearchFlags
|
|
SearchResult
|