Doing Syntax Highlighting
-
I am thinking of using Qt Quick for a project that would involve doing syntax highlighting. Is this something that can be reasonably done with Qt Quick? I was looking at the TextEdit control, but I cannot figure out how to set colors and what-not after text has been entered.
-
At the moment there is unfortunately no easy way to do this apart from creating a text element from scratch in C++. In 5.1 we are going to introduce a new QQuickTextDocument interface which essentially exposes the C++ QTextDocument API to the Qt Quick items.
-
Yes. It should be trivial to port for instance this: http://qt-project.org/doc/qt-5.0/qtwidgets/richtext-syntaxhighlighter.html to work with Qt Quick since they share the same QTextDocument API now.