> On Dec 21, 2015, at 10:10 PM, Knut Petter Svendsen 
> <knutpett+qtcrea...@pvv.org> wrote:
> 
> 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!

I think making your mime type a subclass of xml and setting 
setUseGenericHighlighter(true) in your editor factory (see 
PlainTextEditorFactory) should be enough to do the job.

Br, Eike


-- 
Eike Ziller, Senior Software Engineer - The Qt Company GmbH
 
The Qt Company GmbH, Rudower Chaussee 13, D-12489 Berlin
Geschäftsführer: Mika Pälsi, Juha Varelius, Tuula Haataja
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 
144331 B

_______________________________________________
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator

Reply via email to