Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
656d8e65
Commit
656d8e65
authored
Jun 04, 2013
by
Bryant
Browse files
Cleaned up the LinechartWidget::addCurve()
parent
f89cbf71
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ui/linechart/LinechartWidget.cc
View file @
656d8e65
...
...
@@ -652,34 +652,26 @@ void LinechartWidget::addCurve(const QString& curve, const QString& unit)
int
labelRow
=
curvesWidgetLayout
->
rowCount
();
// Checkbox
checkBox
=
new
QCheckBox
(
this
);
checkBox
->
setCheckable
(
true
);
checkBox
->
setObjectName
(
curve
+
unit
);
checkBox
->
setToolTip
(
tr
(
"Enable the curve in the graph window"
));
checkBox
->
setWhatsThis
(
tr
(
"Enable the curve in the graph window"
));
curvesWidgetLayout
->
addWidget
(
checkBox
,
labelRow
,
0
);
// Icon
QWidget
*
colorIcon
=
new
QWidget
(
this
);
colorIcons
.
insert
(
curve
+
unit
,
colorIcon
);
colorIcon
->
setMinimumSize
(
QSize
(
5
,
14
));
colorIcon
->
setMaximumSize
(
4
,
14
);
curvesWidgetLayout
->
addWidget
(
colorIcon
,
labelRow
,
1
);
// Label
label
=
new
QLabel
(
this
);
curvesWidgetLayout
->
addWidget
(
label
,
labelRow
,
2
);
//checkBox->setText(QString());
label
->
setText
(
getCurveName
(
curve
+
unit
,
ui
.
shortNameCheckBox
->
isChecked
()));
QColor
color
(
Qt
::
gray
);
// = plot->getColorForCurve(curve+unit);
QString
colorstyle
;
colorstyle
=
colorstyle
.
sprintf
(
"QWidget { background-color: #%X%X%X; }"
,
color
.
red
(),
color
.
green
(),
color
.
blue
());
colorIcon
->
setStyleSheet
(
colorstyle
);
colorIcon
->
setAutoFillBackground
(
true
);
// Label
curveNameLabels
.
insert
(
curve
+
unit
,
label
);
curvesWidgetLayout
->
addWidget
(
label
,
labelRow
,
2
);
// Value
value
=
new
QLabel
(
this
);
...
...
@@ -693,8 +685,6 @@ void LinechartWidget::addCurve(const QString& curve, const QString& unit)
// Unit
unitLabel
=
new
QLabel
(
this
);
unitLabel
->
setText
(
unit
);
unitLabel
->
setStyleSheet
(
QString
(
"QLabel {color: %1;}"
).
arg
(
"#AAAAAA"
));
//qDebug() << "UNIT" << unit;
unitLabel
->
setToolTip
(
tr
(
"Unit of "
)
+
curve
);
unitLabel
->
setWhatsThis
(
tr
(
"Unit of "
)
+
curve
);
curvesWidgetLayout
->
addWidget
(
unitLabel
,
labelRow
,
4
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment