ECodeView Code view
Examples
Syntax highlighting and copying
Hide line numbers
Hide the copy button
JavaScript code
Plain text display
Properties
backgroundColorcolorCode view background color.
ETheme.dark ? "#1D2129" : "#F6F8FC"codestringOriginal code text used for display and full-source copying.
""enabledboolAllow interaction; false disables the control.
truefontfontFont settings for the family, size and text style.
Common fields:
family, pixelSize, pointSize
bold, italic, weight
underline, strikeout
letterSpacing, wordSpacing
Qt.font({ pixelSize: 16 })heightrealComponent size in pixels; may be bound to its parent layout.
implicitHeighthighlightboolEnable QML / JavaScript syntax highlighting.
truelanguagestringHighlighting language: qml or javascript / js; other values use plain text colors.
"qml"lineHeightrealCode line height in pixels, at least the font pixel size.
22showCopyboolShow the full-source copy button.
trueshowLineNumbersboolShow the line number gutter.
truesyntaxColorsvarHighlight colors by role, such as plain, keyword, and string.
Show default value
({ plain: EPaletteManager.ThemePalette.textPrimary(ETheme.dark), type: ETheme.dark ? "#71CED1" : "#087F8C", property: ETheme.dark ? "#89B4FA" : "#315EB5", keyword: ETheme.dark ? "#C4A7E7" : "#8255AD", literal: ETheme.dark ? "#C4A7E7" : "#8255AD", string: ETheme.dark ? "#A6D3A0" : "#27775B", number: ETheme.dark ? "#E6B673" : "#A15C21", member: ETheme.dark ? "#89B4FA" : "#315EB5", comment: EPaletteManager.ThemePalette.textSecondary(ETheme.dark), punctuation: EPaletteManager.ThemePalette.textSecondary(ETheme.dark) })visibleboolWhether the component is visible.
truewidthrealComponent size in pixels; may be bound to its parent layout.
implicitWidthcontentHeightrealRead onlyFull code content height including vertical spacing.
Computed at runtimelineCountintRead onlyNumber of lines in the original code.
Computed at runtimeselectedTextstringRead onlyCurrently selected code text.
Computed at runtimetextItemaliasRead onlyRead-only text display and selection item.
Computed at runtimeviewportaliasRead onlyCode scrolling viewport; scroll positions can be read and set.
Computed at runtimeSignals
copied(string text)Emitted after copying; text contains the copied content.
Methods
copy()Copy the displayed code to the clipboard.