Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
0fe8ae9d
Commit
0fe8ae9d
authored
Aug 13, 2019
by
Stefan Dunca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
custom-example: add showAttitudeWidget as a persistent option
parent
73a4286d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
CustomQuickInterface.cc
custom-example/src/CustomQuickInterface.cc
+16
-1
CustomQuickInterface.h
custom-example/src/CustomQuickInterface.h
+8
-0
No files found.
custom-example/src/CustomQuickInterface.cc
View file @
0fe8ae9d
...
...
@@ -25,6 +25,7 @@
static
const
char
*
kGroupName
=
"CustomSettings"
;
static
const
char
*
kShowGimbalCtl
=
"ShowGimbalCtl"
;
static
const
char
*
kShowAttitudeWidget
=
"ShowAttitudeWidget"
;
//-----------------------------------------------------------------------------
CustomQuickInterface
::
CustomQuickInterface
(
QObject
*
parent
)
...
...
@@ -45,7 +46,8 @@ CustomQuickInterface::init()
{
QSettings
settings
;
settings
.
beginGroup
(
kGroupName
);
_showGimbalControl
=
settings
.
value
(
kShowGimbalCtl
,
true
).
toBool
();
_showGimbalControl
=
settings
.
value
(
kShowGimbalCtl
,
false
).
toBool
();
_showAttitudeWidget
=
settings
.
value
(
kShowAttitudeWidget
,
false
).
toBool
();
}
//-----------------------------------------------------------------------------
...
...
@@ -60,3 +62,16 @@ CustomQuickInterface::setShowGimbalControl(bool set)
emit
showGimbalControlChanged
();
}
}
//-----------------------------------------------------------------------------
void
CustomQuickInterface
::
setShowAttitudeWidget
(
bool
set
)
{
if
(
_showAttitudeWidget
!=
set
)
{
_showAttitudeWidget
=
set
;
QSettings
settings
;
settings
.
beginGroup
(
kGroupName
);
settings
.
setValue
(
kShowAttitudeWidget
,
set
);
emit
showAttitudeWidgetChanged
();
}
}
custom-example/src/CustomQuickInterface.h
View file @
0fe8ae9d
...
...
@@ -29,12 +29,20 @@ public:
CustomQuickInterface
(
QObject
*
parent
=
nullptr
);
~
CustomQuickInterface
();
Q_PROPERTY
(
bool
showGimbalControl
READ
showGimbalControl
WRITE
setShowGimbalControl
NOTIFY
showGimbalControlChanged
)
Q_PROPERTY
(
bool
showAttitudeWidget
READ
showAttitudeWidget
WRITE
setShowAttitudeWidget
NOTIFY
showAttitudeWidgetChanged
)
bool
showGimbalControl
()
{
return
_showGimbalControl
;
}
void
setShowGimbalControl
(
bool
set
);
void
init
();
bool
showAttitudeWidget
()
{
return
_showAttitudeWidget
;
}
void
setShowAttitudeWidget
(
bool
set
);
signals:
void
showGimbalControlChanged
();
void
showAttitudeWidgetChanged
();
private:
bool
_showGimbalControl
=
true
;
bool
_showAttitudeWidget
=
false
;
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment