Table des matières

QET Coding style

Inspired from http://qt-project.org/wiki/Qt_Coding_Style

This is an overview of the coding conventions to be used when writing code for the QElectroTech project.

Indentation and alignment

Encoding

Regarding indentation, some may argue that horizontal tab is considered a control character and thus not a printable one. Feel free to discuss that topic on a rainy sunday during a power outage, but the QElectroTech project accepts that non-printable character in its code. However, we *flee* non-ASCII characters: insert Unicode characters using HTML entities such as &#xHH; or octal notation such as \0321, but strive on remaining within the warm and well-known ASCII table. That should spare you some compilation/portability issues.

End of lines

Unix-style only, Unix-style everywhere: lines should be separated with a LF (Line Feed, the Unix way) character, not a CR (Carriage Return, the Mac way) nor a CRLF (the Windows way). The last line of a file should also end with a LF.

Declaring variables

Whitespace

Braces

Line breaks

Parentheses

Switch statements

Declaring methods

	/**
		Represents the kind of a particular conductor:
		  * Simple: no symbols, no text input
		  * Single: singleline symbols, no text input
		  * Multi: text input, no symbol
	*/
	enum ConductorType { Simple, Single, Multi };

What to commit

TODO Describe conventions to follow when declaring a class.