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
cf2bd6a3
Commit
cf2bd6a3
authored
Apr 10, 2013
by
Michael Carpenter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handling of QVariant::Char display type in QGCParamWidget::addParameter
parent
8a885d53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
2 deletions
+30
-2
QGCParamWidget.cc
src/ui/QGCParamWidget.cc
+30
-2
No files found.
src/ui/QGCParamWidget.cc
View file @
cf2bd6a3
...
...
@@ -400,6 +400,7 @@ void QGCParamWidget::addParameter(int uas, int component, int paramCount, int pa
if
(
map
&&
map
->
contains
(
parameterName
))
{
justWritten
=
true
;
QVariant
newval
=
map
->
value
(
parameterName
);
if
(
map
->
value
(
parameterName
)
!=
value
)
{
writeMismatch
=
true
;
...
...
@@ -551,7 +552,14 @@ void QGCParamWidget::addParameter(int uas, int component, QString parameterName,
{
//qDebug() << "UPDATED CHILD";
parameterItem
=
child
;
parameterItem
->
setData
(
1
,
Qt
::
DisplayRole
,
value
);
if
(
value
.
type
()
==
QVariant
::
Char
)
{
parameterItem
->
setData
(
1
,
Qt
::
DisplayRole
,
value
.
toUInt
());
}
else
{
parameterItem
->
setData
(
1
,
Qt
::
DisplayRole
,
value
);
}
found
=
true
;
}
}
...
...
@@ -564,7 +572,14 @@ void QGCParamWidget::addParameter(int uas, int component, QString parameterName,
// CREATE PARAMETER ITEM
parameterItem
=
new
QTreeWidgetItem
(
plist
);
// CONFIGURE PARAMETER ITEM
parameterItem
->
setData
(
1
,
Qt
::
DisplayRole
,
value
);
if
(
value
.
type
()
==
QVariant
::
Char
)
{
parameterItem
->
setData
(
1
,
Qt
::
DisplayRole
,
value
.
toUInt
());
}
else
{
parameterItem
->
setData
(
1
,
Qt
::
DisplayRole
,
value
);
}
compParamGroups
->
value
(
parent
)
->
addChild
(
parameterItem
);
parameterItem
->
setFlags
(
parameterItem
->
flags
()
|
Qt
::
ItemIsEditable
);
...
...
@@ -708,6 +723,12 @@ void QGCParamWidget::parameterItemChanged(QTreeWidgetItem* current, int column)
parameters
.
value
(
key
)
->
insert
(
str
,
fixedValue
);
}
break
;
case
QMetaType
:
:
QChar
:
{
QVariant
fixedValue
(
QChar
((
unsigned
char
)
value
.
toUInt
()));
parameters
.
value
(
key
)
->
insert
(
str
,
fixedValue
);
}
break
;
default:
qCritical
()
<<
"ABORTED PARAM UPDATE, NO VALID QVARIANT TYPE"
;
return
;
...
...
@@ -999,6 +1020,13 @@ void QGCParamWidget::setParameter(int component, QString parameterName, QVariant
switch
(
parameters
.
value
(
component
)
->
value
(
parameterName
).
type
())
{
case
QVariant
:
:
Char
:
{
QVariant
fixedValue
(
QChar
((
unsigned
char
)
value
.
toInt
()));
emit
parameterChanged
(
component
,
parameterName
,
fixedValue
);
//qDebug() << "PARAM WIDGET SENT:" << fixedValue;
}
break
;
case
QVariant
:
:
Int
:
{
QVariant
fixedValue
(
value
.
toInt
());
...
...
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