[Qt-creator] Syntax highlighting, EditorWidget and XML

Knut Petter Svendsen knutpett+qtcreator at pvv.org
Mon Dec 21 22:10:57 CET 2015


Hi!

I'm implementing a small plugin with my own EditorWidget inheriting TextEditorWidget to get my own code navigation.
The editor is for a file based on XML. I've implemented findLinkAt and that works. Since the file has xml-syntax I'd
like it to use XML syntax highlighting. How do I get that without having to implement my own syntax highlighter?

I've tried to make my own mime-type and let it be a sub-class-of application/xml, but that doesn't help. It helps by
adding my file extension to application/xml (Tools->...MIME Types) but then it seems to ruin for my EditorWidget
(wrong editor opened?)

Any help would be appreciated!

-- 
Knut Petter




More information about the Qt-creator mailing list