Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qgroundcontrol
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Valentin Platzgummer
qgroundcontrol
Commits
205184be
Commit
205184be
authored
10 years ago
by
Don Gagne
Browse files
Options
Downloads
Patches
Plain Diff
Updates taking into account feedback
parent
cdaa0296
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CodingStyle.cc
+18
-2
18 additions, 2 deletions
CodingStyle.cc
CodingStyle.h
+12
-2
12 additions, 2 deletions
CodingStyle.h
with
30 additions
and
4 deletions
CodingStyle.cc
+
18
−
2
View file @
205184be
...
...
@@ -2,7 +2,7 @@
QGroundControl Open Source Ground Control Station
(c) 2009 - 201
4
QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
(c) 2009 - 201
5
QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
...
...
@@ -37,10 +37,14 @@
#include
<QFile>
#include
<QDebug>
#include
<math.h>
// Note how the Qt headers and the QGroundControl headers above are kept seperate
Q_LOGGING_CATEGORY
(
CodingStyleLog
,
"CodingStyleLog"
)
const
int
CodingStyle
::
_privateStaticVariable
=
0
;
CodingStyle
::
CodingStyle
(
QObject
*
parent
)
:
QObject
(
parent
),
_protectedVariable
(
1
),
...
...
@@ -85,8 +89,10 @@ void CodingStyle::_privateMethod2(void)
typedValue
.
setValue
(
value
.
toUInt
());
break
;
case
FactMetaData
::
valueTypeFloat
:
case
FactMetaData
::
valueTypeFloat
:
{
int
localScopedVar
=
1
;
typedValue
.
setValue
(
value
.
toFloat
());
}
break
;
case
FactMetaData
::
valueTypeDouble
:
...
...
@@ -94,3 +100,13 @@ void CodingStyle::_privateMethod2(void)
break
;
}
}
void
CodingStyle
::
_methodWithManyArguments
(
QWidget
*
parent
,
const
QString
&
caption
,
const
QString
&
dir
,
Options
options1
,
Options
options2
,
Options
options3
)
{
// Implementataion here...
}
This diff is collapsed.
Click to expand it.
CodingStyle.h
+
12
−
2
View file @
205184be
...
...
@@ -39,16 +39,22 @@
#include
<QXmlStreamReader>
#include
<QLoggingCategory>
#include
<limits.h>
#include
"Fact.h"
#include
"UASInterface.h"
// Note how the Qt headers and the QGroundControl headers above are kept seperate
// Note how the Qt
headers, Syste,
headers and the QGroundControl headers above are kept
in
seperate
groups
// If you are going to use a logging category for a class it should have the same name as the class
// with a suffix of Log.
Q_DECLARE_LOGGING_CATEGORY
(
CodingStyleLog
)
/// Here is the class documentation. Class names are PascalCase.
/// Here is the class documentation. Class names are PascalCase. If you override any of the Qt base classes to provide
/// generic base implementations for widespread use prefix the class name with QGC. For example:
/// QGCMessageBox - is a QGC special vesion of Qt MessageBox
/// QGCPalette - is a QGC special version of Qt Palette
/// For normal single use classes do no prefix them name with QGC.
class
CodingStyle
:
public
QObject
{
...
...
@@ -84,10 +90,14 @@ private:
// non-obvious private methods goes in the code file, not the header.
void
_privateMethod
(
void
);
void
_methodWithManyArguments
(
QWidget
*
parent
,
const
QString
&
caption
,
const
QString
&
dir
,
Options
options1
,
Options
options2
,
Options
options3
);
/// Document non-obvious variables in the header file. Long descriptions go here.
int
_privateVariable1
;
int
_privateVariable2
;
///< Short descriptions go here
static
const
int
_privateStaticVariable
;
};
#endif
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment