From f0551b8645d9e3babf35e40fbc74c02ec8990e58 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Fri, 22 Sep 2017 16:44:19 +0200 Subject: Updated documentation --- docs/manual/Contributing.Style.md | 70 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 docs/manual/Contributing.Style.md (limited to 'docs/manual/Contributing.Style.md') diff --git a/docs/manual/Contributing.Style.md b/docs/manual/Contributing.Style.md new file mode 100644 index 0000000..1ab6b17 --- /dev/null +++ b/docs/manual/Contributing.Style.md @@ -0,0 +1,70 @@ +# Code style + +## Guidelines +* Use generic formats +* Where possible, use QVector over QList: +http://lists.qt-project.org/pipermail/development/2017-March/029040.html + +## Versioning + +#### Major version +Changed infrequently and almost entirely out of foppery and whim. + +#### Minor version +Milestone of multiple features. + +#### Revision +Major bugfixes and each new feature should get a revision. + +### Branching +* master - main branch, should be kept up-to-date, and have only working code +* next - next stable release preparation, mostly for bugfixes +* development - development branch, anything goes there + +### Folder structure + + folder | description + ------ | ----------- +/src | source code +/src/widgets | subclassed Qt widgets +/src/formats | file format parsing (toml, xbel) +/src/forms | Qt UI forms and classes +/src/webengine | QWebEngine subclasses +/test | test run location, mainly for QtCreator + + +## clazy +You can use [clazy](https://github.com/KDE/clazy) to check Qt semantics. +Requires clang. + +To set check levels, set the CLAZY_CHECKS environment variable to 'level0,level1', etc. + +### Setting up in QtCreator +The simplest way to set it up is to use _clazy_ instead of _clang_. + +1. Go to Tools » Options » Build & Run » Compilers +2. Clone the clang compiler of your choice +3. Set _Compiler path_ to _/usr/bin/clazy_ + +This will update the qbs profile that QtCreator uses. + +### Reducing clazy noise +If you want to suppress warnings from headers of Qt or 3rd party code, include +them with -isystem instead of -I. To do this, you have to +[modify your Qt profile](clazy-sysincludes) like this: + +Find the profile's search path: +```sh +$ qbs config --list profiles.qt562.preferences +profiles.qt562.preferences.qbsSearchPaths: "/home/someone/.config/QtProject/qbs/1.9.0/profiles/qt562" +``` + +Replace cpp.includePaths with cpp.systemIncludePaths in the Qt modules of that +profile: + +```sh +$ find /home/someone/.config/QtProject/qbs/1.9.0/profiles/qt562/modules/Qt/ -name '*.qbs' | xargs -n1 sed -i s/cpp\.includePaths/cpp.systemIncludePaths/ +``` + +[clazy-sysincludes]: http://lists.qt-project.org/pipermail/qbs/2017-April/001709.html + -- cgit v1.2.1