Add formatter for QML

This commit is contained in:
Alexandre Jörgensen 2026-03-10 12:25:28 +01:00
parent d2413f33a9
commit ae75e5eff9
2 changed files with 40 additions and 0 deletions

26
.qmlformat.ini Normal file
View file

@ -0,0 +1,26 @@
# Copyright (c) 2010-2026 Belledonne Communications SARL.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# The doc of the format could be find here : https://doc.qt.io/qt-6/qtqml-tooling-qmlformat.html
[General]
UseTabs=true
IndentWidth=4
MaxColumnWidth=120
NormalizeOrder=false
FunctionsSpacing=false
ObjectsSpacing=false
SortImports=false
SemicolonRule=always

View file

@ -351,6 +351,20 @@ Please note that we don't offer free support and these contributions will be add
- external : external projects.
- linphone-sdk
#### Formating
Code is formated using `clang` for C++ and `qmlformat` for QML
##### Configuration
* **VSCode**
1. Install the followings extentions : [Qt Qml](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.qt-qml) and [Clang-Format](https://marketplace.visualstudio.com/items?itemName=xaver.clang-format)
2. Add the following lines to your vscode settings workspace file `settings.json`
```json
"editor.formatOnSave": true,
"clang-format.executable": ".clang-format",
```
#### Add new text/label
For each text/label that you want to put in the application, you need to follow thoses steps: