Skip to content
Components/Data displayIntroduced in 1.2.0

ECodeView Code view ​

import EUI 1.0

Examples ​

Syntax highlighting and copying ​

QML sourceQML
Preview
Run the code to try the component

Edit text, properties, or events, then select Run.

Code runs in this browser Licenses

Hide line numbers ​

QML sourceQML
Preview
Run the code to try the component

Edit text, properties, or events, then select Run.

Code runs in this browser Licenses

Hide the copy button ​

QML sourceQML
Preview
Run the code to try the component

Edit text, properties, or events, then select Run.

Code runs in this browser Licenses

JavaScript code ​

QML sourceQML
Preview
Run the code to try the component

Edit text, properties, or events, then select Run.

Code runs in this browser Licenses

Plain text display ​

QML sourceQML
Preview
Run the code to try the component

Edit text, properties, or events, then select Run.

Code runs in this browser Licenses

Properties ​

PropertyDescriptionValues and default
backgroundColorcolor

Code view background color.

DefaultETheme.dark ? "#1D2129" : "#F6F8FC"
codestring

Original code text used for display and full-source copying.

Default""
enabledbool

Allow interaction; false disables the control.

Defaulttrue
fontfont

Font settings for the family, size and text style.

Common fields:
family, pixelSize, pointSize
bold, italic, weight
underline, strikeout
letterSpacing, wordSpacing

DefaultQt.font({ pixelSize: 16 })
heightreal

Component size in pixels; may be bound to its parent layout.

DefaultimplicitHeight
highlightbool

Enable QML / JavaScript syntax highlighting.

Defaulttrue
languagestring

Highlighting language: qml or javascript / js; other values use plain text colors.

Default"qml"
lineHeightreal

Code line height in pixels, at least the font pixel size.

Default22
showCopybool

Show the full-source copy button.

Defaulttrue
showLineNumbersbool

Show the line number gutter.

Defaulttrue
syntaxColorsvar

Highlight colors by role, such as plain, keyword, and string.

Default
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) })
visiblebool

Whether the component is visible.

Defaulttrue
widthreal

Component size in pixels; may be bound to its parent layout.

DefaultimplicitWidth
contentHeightrealRead only

Full code content height including vertical spacing.

DefaultComputed at runtime
lineCountintRead only

Number of lines in the original code.

DefaultComputed at runtime
selectedTextstringRead only

Currently selected code text.

DefaultComputed at runtime
textItemaliasRead only

Read-only text display and selection item.

DefaultComputed at runtime
viewportaliasRead only

Code scrolling viewport; scroll positions can be read and set.

DefaultComputed at runtime

Signals ​

SignaturePurpose
copied(string text)

Emitted after copying; text contains the copied content.

Methods ​

SignaturePurpose
copy()

Copy the displayed code to the clipboard.

Released under the MIT License. Third-party assets retain their own licenses.