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
0c4de36b
Commit
0c4de36b
authored
10 years ago
by
Bryant Mairs
Browse files
Options
Downloads
Patches
Plain Diff
Fixed apmtoolbar.
parent
f3b414ed
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ui/apmtoolbar.cpp
+7
-12
7 additions, 12 deletions
src/ui/apmtoolbar.cpp
with
7 additions
and
12 deletions
src/ui/apmtoolbar.cpp
+
7
−
12
View file @
0c4de36b
#include
<QDebug>
#include
<QQmlContext>
#include
<QGraphicsObject>
#include
<QQuickItem>
#include
"LinkManager.h"
#include
"MainWindow.h"
...
...
@@ -21,7 +22,7 @@ APMToolBar::APMToolBar(QWidget *parent):
setSource
(
QUrl
::
fromLocalFile
(
"qml/ApmToolBar.qml"
));
#endif
setResizeMode
(
QQuickView
::
SizeRootObjectToView
);
this
->
rootContext
()
->
setContextProperty
(
"globalObj"
,
this
);
rootContext
()
->
setContextProperty
(
"globalObj"
,
this
);
connect
(
LinkManager
::
instance
(),
SIGNAL
(
newLink
(
LinkInterface
*
)),
this
,
SLOT
(
updateLinkDisplay
(
LinkInterface
*
)));
...
...
@@ -55,8 +56,7 @@ void APMToolBar::activeUasSet(UASInterface *uas)
}
void
APMToolBar
::
armingChanged
(
bool
armed
)
{
// FIXME: This doesn't work in Qt5, figure out what it should be
//this->rootObject()->setProperty("armed",armed);
rootObject
()
->
setProperty
(
"armed"
,
armed
);
}
void
APMToolBar
::
armingChanged
(
int
sysId
,
QString
armingState
)
...
...
@@ -162,9 +162,7 @@ void APMToolBar::connectMAV()
void
APMToolBar
::
setConnection
(
bool
connection
)
{
// Change the image to represent the state
// FIXME: Doesn't work the same in Qt5, fix this
//QObject *object = rootObject();
//object->setProperty("connected", connection);
rootObject
()
->
setProperty
(
"connected"
,
connection
);
}
APMToolBar
::~
APMToolBar
()
...
...
@@ -200,17 +198,14 @@ void APMToolBar::showConnectionDialog()
void
APMToolBar
::
updateLinkDisplay
(
LinkInterface
*
newLink
)
{
qDebug
()
<<
"APMToolBar: updateLinkDisplay"
;
// FIXME: Doesn't work the same in Qt5, fix this.
//QObject *object = rootObject();
QObject
*
object
=
rootObject
();
if
(
newLink
&&
rootObject
()){
qint64
baudrate
=
newLink
->
getConnectionSpeed
();
// FIXME: Doesn't work in Qt5
//object->setProperty("baudrateLabel", QString::number(baudrate));
object
->
setProperty
(
"baudrateLabel"
,
QString
::
number
(
baudrate
));
QString
linkName
=
newLink
->
getName
();
// FIXME: Doesn't work in Qt5
//object->setProperty("linkNameLabel", linkName);
object
->
setProperty
(
"linkNameLabel"
,
linkName
);
connect
(
newLink
,
SIGNAL
(
connected
(
bool
)),
this
,
SLOT
(
setConnection
(
bool
)));
...
...
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