Policies/Frameworks Coding Style: Difference between revisions

From KDE TechBase
(Initial stub for KF5 coding style)
 
(Remove duplicated content and link to Community instead)
Tag: Replaced
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Note|1=This is a style guide for KDE Frameworks 5. If you write code that is not targeted at KF5, but only at KDE SC 4, refer to [[Policies/Kdelibs_Coding_Style|that style guide]].}}
This content was moved to https://community.kde.org/Policies/Frameworks_Coding_Style
 
== Indentation ==
* 4 spaces
* no tabs
 
== Qt Includes ==
* For Qt #includes omit the module name and only use the class name. That way chances are good that future migrations of Qt classes between different modules do not need any adjustments in the code.
 
Example:
<syntaxhighlight lang="cpp-qt">
// wrong
#include <QtCore/QString>
 
// correct
#include <QString>
</syntaxhighlight>
 
 
{{Note|1=This policy applies to KF5 and is the exact opposite of the preferred style for kdelibs in KDE SC 4.}}

Latest revision as of 14:05, 3 April 2023