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
f50b692f
Commit
f50b692f
authored
Jun 25, 2017
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow plugins to create (native) root window
parent
6dae1e7e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
6 deletions
+19
-6
QGCApplication.cc
src/QGCApplication.cc
+2
-5
QGCCorePlugin.cc
src/api/QGCCorePlugin.cc
+12
-0
QGCCorePlugin.h
src/api/QGCCorePlugin.h
+5
-1
No files found.
src/QGCApplication.cc
View file @
f50b692f
...
@@ -79,6 +79,7 @@
...
@@ -79,6 +79,7 @@
#include "QGCMapPolygon.h"
#include "QGCMapPolygon.h"
#include "ParameterManager.h"
#include "ParameterManager.h"
#include "SettingsManager.h"
#include "SettingsManager.h"
#include "QGCCorePlugin.h"
#ifndef NO_SERIAL_LINK
#ifndef NO_SERIAL_LINK
#include "SerialLink.h"
#include "SerialLink.h"
...
@@ -395,11 +396,7 @@ bool QGCApplication::_initForNormalAppBoot(void)
...
@@ -395,11 +396,7 @@ bool QGCApplication::_initForNormalAppBoot(void)
connect
(
this
,
&
QGCApplication
::
lastWindowClosed
,
this
,
QGCApplication
::
quit
);
connect
(
this
,
&
QGCApplication
::
lastWindowClosed
,
this
,
QGCApplication
::
quit
);
#ifdef __mobile__
#ifdef __mobile__
_qmlAppEngine
=
new
QQmlApplicationEngine
(
this
);
_qmlAppEngine
=
toolbox
()
->
corePlugin
()
->
createRootWindow
(
this
);
_qmlAppEngine
->
addImportPath
(
"qrc:/qml"
);
_qmlAppEngine
->
rootContext
()
->
setContextProperty
(
"joystickManager"
,
toolbox
()
->
joystickManager
());
_qmlAppEngine
->
rootContext
()
->
setContextProperty
(
"debugMessageModel"
,
AppMessages
::
getModel
());
_qmlAppEngine
->
load
(
QUrl
(
QStringLiteral
(
"qrc:/qml/MainWindowNative.qml"
)));
#else
#else
// Start the user interface
// Start the user interface
MainWindow
*
mainWindow
=
MainWindow
::
_create
();
MainWindow
*
mainWindow
=
MainWindow
::
_create
();
...
...
src/api/QGCCorePlugin.cc
View file @
f50b692f
...
@@ -7,11 +7,13 @@
...
@@ -7,11 +7,13 @@
*
*
****************************************************************************/
****************************************************************************/
#include "QGCApplication.h"
#include "QGCCorePlugin.h"
#include "QGCCorePlugin.h"
#include "QGCOptions.h"
#include "QGCOptions.h"
#include "QGCSettings.h"
#include "QGCSettings.h"
#include "FactMetaData.h"
#include "FactMetaData.h"
#include "SettingsManager.h"
#include "SettingsManager.h"
#include "AppMessages.h"
#include <QtQml>
#include <QtQml>
#include <QQmlEngine>
#include <QQmlEngine>
...
@@ -213,3 +215,13 @@ void QGCCorePlugin::valuesWidgetDefaultSettings(QStringList& largeValues, QStrin
...
@@ -213,3 +215,13 @@ void QGCCorePlugin::valuesWidgetDefaultSettings(QStringList& largeValues, QStrin
Q_UNUSED
(
smallValues
);
Q_UNUSED
(
smallValues
);
largeValues
<<
"Vehicle.altitudeRelative"
<<
"Vehicle.groundSpeed"
<<
"Vehicle.flightTime"
;
largeValues
<<
"Vehicle.altitudeRelative"
<<
"Vehicle.groundSpeed"
<<
"Vehicle.flightTime"
;
}
}
QQmlApplicationEngine
*
QGCCorePlugin
::
createRootWindow
(
QObject
*
parent
)
{
QQmlApplicationEngine
*
pEngine
=
new
QQmlApplicationEngine
(
parent
);
pEngine
->
addImportPath
(
"qrc:/qml"
);
pEngine
->
rootContext
()
->
setContextProperty
(
"joystickManager"
,
qgcApp
()
->
toolbox
()
->
joystickManager
());
pEngine
->
rootContext
()
->
setContextProperty
(
"debugMessageModel"
,
AppMessages
::
getModel
());
pEngine
->
load
(
QUrl
(
QStringLiteral
(
"qrc:/qml/MainWindowNative.qml"
)));
return
pEngine
;
}
src/api/QGCCorePlugin.h
View file @
f50b692f
...
@@ -27,6 +27,7 @@ class QGCSettings;
...
@@ -27,6 +27,7 @@ class QGCSettings;
class
QGCCorePlugin_p
;
class
QGCCorePlugin_p
;
class
FactMetaData
;
class
FactMetaData
;
class
QGeoPositionInfoSource
;
class
QGeoPositionInfoSource
;
class
QQmlApplicationEngine
;
class
QGCCorePlugin
:
public
QGCTool
class
QGCCorePlugin
:
public
QGCTool
{
{
...
@@ -83,9 +84,12 @@ public:
...
@@ -83,9 +84,12 @@ public:
/// Allows a plugin to override the specified color name from the palette
/// Allows a plugin to override the specified color name from the palette
virtual
void
paletteOverride
(
QString
colorName
,
QGCPalette
::
PaletteColorInfo_t
&
colorInfo
);
virtual
void
paletteOverride
(
QString
colorName
,
QGCPalette
::
PaletteColorInfo_t
&
colorInfo
);
/// Allows the plugin t
he
override the default settings for the Values Widget large and small values
/// Allows the plugin t
o
override the default settings for the Values Widget large and small values
virtual
void
valuesWidgetDefaultSettings
(
QStringList
&
largeValues
,
QStringList
&
smallValues
);
virtual
void
valuesWidgetDefaultSettings
(
QStringList
&
largeValues
,
QStringList
&
smallValues
);
/// Allows the plugin to override the creation of the root (native) window.
virtual
QQmlApplicationEngine
*
createRootWindow
(
QObject
*
parent
);
bool
showTouchAreas
(
void
)
const
{
return
_showTouchAreas
;
}
bool
showTouchAreas
(
void
)
const
{
return
_showTouchAreas
;
}
bool
showAdvancedUI
(
void
)
const
{
return
_showAdvancedUI
;
}
bool
showAdvancedUI
(
void
)
const
{
return
_showAdvancedUI
;
}
void
setShowTouchAreas
(
bool
show
);
void
setShowTouchAreas
(
bool
show
);
...
...
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