I am interested in syntax-highlighting framework. I am writing own Qt widget for viewing files and I want enable syntax highlighting and maybe folding. In data/syntax is many xml files. Where I can get info about how to use it? Also I can use this information not directly from xml, but by using libkf5syntaxhighlighting-dev in Ubuntu. How can I use it?
QPlainTextEdit can use
KSyntaxHighlighting::Repository repository;
KSyntaxHighlighting::SyntaxHighlighter *highlighter;
there is
highlighter->rehighlight()
Is possible use KSyntaxHighlighting with own component?
I found
https://docs.kde.org/trunk5/en/kate/katepart/highlight.html#katehighlight-xml-format
==================
I have repository and definition
KSyntaxHighlighting::Repository repository;
const KSyntaxHighlighting::Definition definition = repository.definitionForFileName("a.c");
Definition has multiLineCommentMarker() and keywordLists()
has also Format
KSyntaxHighlighting::Format format = definition.formats()[5];
but format has no rules, only text attributes
Where are rules, for example: how detect int, identifier or haxadecimal,octal? (without KSyntaxHighlighting::SyntaxHighlighter and QTextDocument)