QML Filetype

QML files are not currently supported by Geany. However, you can setup these rules to get highlighting support for your code. Although, I have been experimenting with the Ubuntu touch API rather than using the default Qt-Creator application, I wanted to use Geany and have some highlighting and be able to test my programs.

First modify filetypes_extensions.conf likely located at ~/.config/geany/filedefs/filetypes_extensions.conf. Create this file if it does not exist. Next, add the below code to the file ( means existing data):

[Extensions]
...
QML=*.qml
...
 
[Groups]
...
Misc=QML
...

And create a new filedef named filetypes.QML.conf with the following contents:

filetypes.QML.conf
[styling]
default=default
number=number
string=string
word=word
identifier=identifier,bold
 
[keywords]
primary=true false null
 
[settings]
lexer_filetype=QML
extension=qml
comment_single=
 
[indentation]
width=2
# 0 is spaces, 1 is tabs, 2 is tab & spaces
type=0

Build Commands

In Geany, go to the Build menu and 'Set Build Commands…' and use qmlscene %f as the compile command, and ([^:]+):([0-9]+) as the Error Regular Expression.

Print/export