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
d4e5dabf
Commit
d4e5dabf
authored
May 19, 2014
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Designer widgets: Ensure correct initialization sequence, make sure signals are only connected once
parent
bc23c2db
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
22 deletions
+32
-22
QGCComboBox.cc
src/ui/designer/QGCComboBox.cc
+1
-4
QGCCommandButton.cc
src/ui/designer/QGCCommandButton.cc
+2
-0
QGCParamSlider.cc
src/ui/designer/QGCParamSlider.cc
+6
-3
QGCParamSlider.ui
src/ui/designer/QGCParamSlider.ui
+13
-13
QGCTextLabel.cc
src/ui/designer/QGCTextLabel.cc
+2
-0
QGCToolWidgetItem.cc
src/ui/designer/QGCToolWidgetItem.cc
+7
-2
QGCToolWidgetItem.h
src/ui/designer/QGCToolWidgetItem.h
+1
-0
No files found.
src/ui/designer/QGCComboBox.cc
View file @
d4e5dabf
...
...
@@ -23,7 +23,6 @@ QGCComboBox::QGCComboBox(QWidget *parent) :
ui
->
setupUi
(
this
);
uas
=
NULL
;
ui
->
editInfoCheckBox
->
hide
();
ui
->
editDoneButton
->
hide
();
ui
->
editNameLabel
->
hide
();
...
...
@@ -60,10 +59,8 @@ QGCComboBox::QGCComboBox(QWidget *parent) :
connect
(
ui
->
editInfoCheckBox
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
showInfo
(
bool
)));
// connect to self
connect
(
ui
->
infoLabel
,
SIGNAL
(
released
()),
this
,
SLOT
(
showTooltip
()));
// Set the current UAS if present
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
setActiveUAS
(
UASInterface
*
)));
init
();
}
QGCComboBox
::~
QGCComboBox
()
...
...
src/ui/designer/QGCCommandButton.cc
View file @
d4e5dabf
...
...
@@ -84,6 +84,8 @@ QGCCommandButton::QGCCommandButton(QWidget *parent) :
ui
->
editCommandComboBox
->
addItem
(
"MAV_CMD_MISSION_START"
,
MAV_CMD_MISSION_START
);
ui
->
editCommandComboBox
->
addItem
(
"MAV_CMD_COMPONENT_ARM_DISARM"
,
MAV_CMD_COMPONENT_ARM_DISARM
);
ui
->
editCommandComboBox
->
setEditable
(
true
);
init
();
}
QGCCommandButton
::~
QGCCommandButton
()
...
...
src/ui/designer/QGCParamSlider.cc
View file @
d4e5dabf
...
...
@@ -69,9 +69,9 @@ QGCParamSlider::QGCParamSlider(QWidget *parent) :
// connect to self
connect
(
ui
->
infoLabel
,
SIGNAL
(
released
()),
this
,
SLOT
(
showTooltip
()));
// Set the current UAS if present
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
setActiveUAS
(
UASInterface
*
))
);
init
();
requestParameter
(
);
}
QGCParamSlider
::~
QGCParamSlider
()
...
...
@@ -220,6 +220,8 @@ void QGCParamSlider::setEditMode(bool editMode)
parameterMin
=
ui
->
editMinSpinBox
->
value
();
parameterMax
=
ui
->
editMaxSpinBox
->
value
();
requestParameter
();
switch
((
int
)
parameterValue
.
type
())
{
case
QVariant
:
:
Char
:
...
...
@@ -264,6 +266,7 @@ void QGCParamSlider::setParamPending()
{
if
(
uas
)
{
uas
->
getParamManager
()
->
setPendingParam
(
componentId
,
parameterName
,
parameterValue
);
uas
->
getParamManager
()
->
sendPendingParameters
(
true
,
true
);
}
else
{
qWarning
()
<<
__FILE__
<<
__LINE__
<<
"NO UAS SET, DOING NOTHING"
;
...
...
src/ui/designer/QGCParamSlider.ui
View file @
d4e5dabf
...
...
@@ -143,19 +143,6 @@
</property>
</widget>
</item>
<item
row=
"5"
column=
"2"
colspan=
"9"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
40
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"2"
column=
"10"
>
<widget
class=
"QPushButton"
name=
"readButton"
>
<property
name=
"minimumSize"
>
...
...
@@ -286,6 +273,19 @@
</property>
</widget>
</item>
<item
row=
"5"
column=
"0"
colspan=
"11"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
40
</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
...
...
src/ui/designer/QGCTextLabel.cc
View file @
d4e5dabf
...
...
@@ -24,6 +24,8 @@ QGCTextLabel::QGCTextLabel(QWidget *parent) :
ui
->
editLine2
->
hide
();
ui
->
isMavCommand
->
hide
();
ui
->
textLabel
->
setText
(
QString
());
init
();
}
QGCTextLabel
::~
QGCTextLabel
()
...
...
src/ui/designer/QGCToolWidgetItem.cc
View file @
d4e5dabf
...
...
@@ -15,14 +15,19 @@ QGCToolWidgetItem::QGCToolWidgetItem(const QString& name, QWidget *parent) :
_component
(
-
1
)
{
startEditAction
=
new
QAction
(
tr
(
"Edit %1"
).
arg
(
qgcToolWidgetItemName
),
this
);
connect
(
startEditAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
startEditMode
()));
stopEditAction
=
new
QAction
(
tr
(
"Finish Editing %1"
).
arg
(
qgcToolWidgetItemName
),
this
);
connect
(
stopEditAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
endEditMode
()));
deleteAction
=
new
QAction
(
tr
(
"Delete %1"
).
arg
(
qgcToolWidgetItemName
),
this
);
}
void
QGCToolWidgetItem
::
init
()
{
connect
(
startEditAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
startEditMode
()));
connect
(
stopEditAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
endEditMode
()));
connect
(
deleteAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
deleteLater
()));
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
setActiveUAS
(
UASInterface
*
)));
// Set first UAS if it exists
setActiveUAS
(
UASManager
::
instance
()
->
getActiveUAS
());
}
...
...
src/ui/designer/QGCToolWidgetItem.h
View file @
d4e5dabf
...
...
@@ -37,6 +37,7 @@ signals:
protected:
void
contextMenuEvent
(
QContextMenuEvent
*
event
);
void
init
();
UASInterface
*
uas
;
private:
...
...
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