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
0c4de36b
Commit
0c4de36b
authored
Jul 16, 2014
by
Bryant Mairs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed apmtoolbar.
parent
f3b414ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
apmtoolbar.cpp
src/ui/apmtoolbar.cpp
+7
-12
No files found.
src/ui/apmtoolbar.cpp
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
)));
...
...
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