Home | |
Header Files |
Prev | Coding Rules | Next |
The following rules apply to all header files.
Header files shall end with the extension .h not .hpp.
All header files shall begin with a comment block as generated by KDevelop.
The remainder of the header file shall be surrounded by include stoppers. The name of the macro used should be the capitalized filename with the dot replaced by an underbar (e.g. KSettingsDlg.h --\> KSETTINGSDLG_H)
All classes designed for use by the KDE interface should begin with a K with each separate word beginning with an uppercase letter e.g KSomethingDlg.
The header file will include other header files in the following fashion and same order:
Example 3.2. Including other header files
//----------------------------------------------------------------------- // QT Headers #include <qtlabel.h> //----------------------------------------------------------------------- // KDE Headers #include <kcombobox.h> //----------------------------------------------------------------------- // Project Headers #include "mymoney/mymoneyfile.h"
Each class should have a kdoc compatable comment header to describe the class and it's function within kmymoney2.
Classes shall begin their declaration as such:
with an appopriate access declared.
Access modifiers should be left flushed in the class declaration with all attributes and methods indented by one tab. The access methods will be in order starting with private. The access identifier should exist even if no attributes or methods exist. Only one identifier can exist of the same type.
All slot methods should begin with slot and signal methods should start with signal. e.g
Attribute names should begin with the m_ prefix to indicate that they are member variables. The variable name should begin with a descriptive identifier such as qcomboboxMethod. Explicit hungarian notation is also fine. Examples of valid variable names can be found below:
Method names should specify a return and argument(s) unless used in a slot or signal where the argument list can be left blank if necessary. The method should start with a lower case letter with each subsequent word having an upper case start letter.
Prev: | Home | Next: |
Coding Rules | Up | Source Files |