Skip to content
Snippets Groups Projects
Commit 417d82ed authored by ovari's avatar ovari Committed by ovari
Browse files

developer/new-developers/qt-qml-coding-style: linkify

Change-Id: I3fdd81f7463aa2100aa9192c0b1708934810dcfb
parent cbbd6e21
No related branches found
No related tags found
No related merge requests found
Qt and QML coding style
=======================
# Qt and QML coding style
## Qt/C++
## Qt/c++
### Signal and slot naming
Both signals and slots should use camelCase.
A signal should use the simple past tense or past participle of some verb, likely prefixed by a short subject. A corresponding slot should be the signal prefixed with the word "on" and not the word "slot". Here are some examples:
A signal should use the simple past tense or past participle of some verb, likely prefixed by a short subject.
A corresponding slot should be the signal prefixed with the word "on" and not the word "slot".
Here are some examples:
```c
// correct
signal:
......@@ -25,14 +29,16 @@ slot:
void slotNavigateToHomeView();
```
---
## QML
## Code formatting
The Qt 5.15.0 version of qmlformat has some issues dealing with comment sections and currently does not discriminate against max columns, so we will continue to format using these guidelines for now.
The following is a comprehensive sample component, adapted from https://doc.qt.io/qt-5/qml-codingconventions.html, that attempts to illustrate the ideally formatted component.
### Code formatting
The Qt 5.15.0 version of qmlformat has some issues dealing with comment sections and currently does not discriminate against max columns, so this formatting style will continue to be used in the guidelines.
The following is a comprehensive sample component, adapted from <https://doc.qt.io/qt-5/qml-codingconventions.html>, that attempts to illustrate the ideally formatted component.
```javascript
/*
* authored by/copyright ...
* authored by/copyright
*/
// Id always on the first line, and always present and called root
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment