Qt5 Syntax Highlighting in QML

后端 未结 5 1548
谎友^
谎友^ 2021-02-05 10:38

I am working on a QtQuick 2.0 presentation and I would like to embed some code samples. is it possible easily to create a syntax highlighting qml element.

C

5条回答
  •  借酒劲吻你
    2021-02-05 11:02

    Qt Quick's TextEdit item exposes a textDocument property, of type QQuickTextDocument. This is explicitly exposed so you can use QSyntaxHighlighter directly with the document.

    QtQuick textEdit documentation for Qt 5.3

提交回复
热议问题