Important: Please read the Qt Code of Conduct -

Generic-highlighter: how to switch/reset it to a different configuration

  • I am trying to take advantage of good QT Creator's editor for working on PHP/HTML files. There is a pretty good documentation on how generic-highlighter works, see, for example,, but somehow I could not find a way to switch from one highlighter to another, once one was assigned, and how to figure out which exactly highlighter is in use for a particular file. Specifically, I have good and helpful highlighting for *.js files, but I keep failing to make highlighter work for *.php files. I found/downloaded, per instructions mentioned above, a few files, which seems to be relevant:

    %USERPROFILE%\AppData\Roaming\QtProject\qtcreator\generic-highlighter\html-php.xml and php.xml

    Both of them list *.php extension inside the <language> tag. How do I check which one is in use? Or maybe none of them, since I do not get any highlighting at all? Then why? How do I make a specific xml highlighter configuration file to be used over the other file? It must have something to do with MIME types in Options->Environment, but all changes I tried did not work for me.

    In the beginning, QT Creator warned me that highlighter is not determined and I downloaded PHP/HTML, etc., then QT Creator stopped complaining, but highlighting did not appear. If I could make it ask again, then I could play with different xml files to find out what is needed, but I could not figure out a way to reset it, so that it would start asking again.

    Does anyone know a location of more extensive documentation, which would explain all those details at length?

    Thank you very much in advance for any hint of help.

Log in to reply