Skip to content

Commit

Permalink
QtLocationPlugin: Update QGCMapEngineManager
Browse files Browse the repository at this point in the history
  • Loading branch information
HTRamsey committed Aug 20, 2024
1 parent 0251034 commit b822875
Show file tree
Hide file tree
Showing 7 changed files with 338 additions and 444 deletions.
3 changes: 0 additions & 3 deletions src/QGCToolbox.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "MAVLinkProtocol.h"
#include "MissionCommandTree.h"
#include "MultiVehicleManager.h"
#include "QGCMapEngineManager.h"
#include "FollowMe.h"
#include "PositionManager.h"
#include "VideoManager.h"
Expand Down Expand Up @@ -55,7 +54,6 @@ QGCToolbox::QGCToolbox(QGCApplication* app)
_mavlinkProtocol = new MAVLinkProtocol (app, this);
_missionCommandTree = new MissionCommandTree (app, this);
_multiVehicleManager = new MultiVehicleManager (app, this);
_mapEngineManager = new QGCMapEngineManager (app, this);
_qgcPositionManager = new QGCPositionManager (app, this);
_followMe = new FollowMe (app, this);
_videoManager = new VideoManager (app, this);
Expand Down Expand Up @@ -85,7 +83,6 @@ void QGCToolbox::setChildToolboxes(void)
_mavlinkProtocol->setToolbox(this);
_missionCommandTree->setToolbox(this);
_multiVehicleManager->setToolbox(this);
_mapEngineManager->setToolbox(this);
_followMe->setToolbox(this);
_qgcPositionManager->setToolbox(this);
_videoManager->setToolbox(this);
Expand Down
3 changes: 0 additions & 3 deletions src/QGCToolbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class LinkManager;
class MAVLinkProtocol;
class MissionCommandTree;
class MultiVehicleManager;
class QGCMapEngineManager;
class QGCApplication;
class QGCPositionManager;
class VideoManager;
Expand Down Expand Up @@ -49,7 +48,6 @@ class QGCToolbox : public QObject {
MAVLinkProtocol* mavlinkProtocol () { return _mavlinkProtocol; }
MissionCommandTree* missionCommandTree () { return _missionCommandTree; }
MultiVehicleManager* multiVehicleManager () { return _multiVehicleManager; }
QGCMapEngineManager* mapEngineManager () { return _mapEngineManager; }
FollowMe* followMe () { return _followMe; }
QGCPositionManager* qgcPositionManager () { return _qgcPositionManager; }
VideoManager* videoManager () { return _videoManager; }
Expand Down Expand Up @@ -80,7 +78,6 @@ class QGCToolbox : public QObject {
MAVLinkProtocol* _mavlinkProtocol = nullptr;
MissionCommandTree* _missionCommandTree = nullptr;
MultiVehicleManager* _multiVehicleManager = nullptr;
QGCMapEngineManager* _mapEngineManager = nullptr;
FollowMe* _followMe = nullptr;
QGCPositionManager* _qgcPositionManager = nullptr;
VideoManager* _videoManager = nullptr;
Expand Down
5 changes: 3 additions & 2 deletions src/QmlControls/QGroundControlQmlGlobal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "FirmwarePluginManager.h"
#include "AppSettings.h"
#include "PositionManager.h"
#include "QGCMapEngineManager.h"
#ifndef NO_SERIAL_LINK
#include "GPSManager.h"
#endif
Expand All @@ -30,7 +31,8 @@ QGeoCoordinate QGroundControlQmlGlobal::_coord = QGeoCoordinate(0.0,0.0);
double QGroundControlQmlGlobal::_zoom = 2;

QGroundControlQmlGlobal::QGroundControlQmlGlobal(QGCApplication* app, QGCToolbox* toolbox)
: QGCTool (app, toolbox)
: QGCTool(app, toolbox)
, _mapEngineManager(QGCMapEngineManager::instance())
{
// We clear the parent on this object since we run into shutdown problems caused by hybrid qml app. Instead we let it leak on shutdown.
// setParent(nullptr);
Expand Down Expand Up @@ -73,7 +75,6 @@ void QGroundControlQmlGlobal::setToolbox(QGCToolbox* toolbox)

_linkManager = toolbox->linkManager();
_multiVehicleManager = toolbox->multiVehicleManager();
_mapEngineManager = toolbox->mapEngineManager();
_qgcPositionManager = toolbox->qgcPositionManager();
_missionCommandTree = toolbox->missionCommandTree();
_videoManager = toolbox->videoManager();
Expand Down
1 change: 1 addition & 0 deletions src/QmlControls/QmlObjectListModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class QmlObjectListModel : public QAbstractListModel
Q_PROPERTY(bool dirty READ dirty WRITE setDirty NOTIFY dirtyChanged)

Q_INVOKABLE QObject* get(int index);
const QObject *get(int index) const;

// Property accessors

Expand Down
13 changes: 3 additions & 10 deletions src/QtLocationPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ endif()
target_link_libraries(QGCLocation
PRIVATE
Qt6::Positioning
QGC
Settings
Utilities
PUBLIC
Expand All @@ -61,7 +62,6 @@ target_link_libraries(QGCLocation
Qt6::LocationPrivate
Qt6::Network
Qt6::Sql
QGC
QmlControls
)

Expand All @@ -71,15 +71,8 @@ target_include_directories(QGCLocation
QMLControl
)

set_source_files_properties(QMLControl/OfflineMap.qml
PROPERTIES
QT_RESOURCE_ALIAS OfflineMap.qml
)

set_source_files_properties(QMLControl/OfflineMapEditor.qml
PROPERTIES
QT_RESOURCE_ALIAS OfflineMapEditor.qml
)
set_source_files_properties(QMLControl/OfflineMap.qml PROPERTIES QT_RESOURCE_ALIAS OfflineMap.qml)
set_source_files_properties(QMLControl/OfflineMapEditor.qml PROPERTIES QT_RESOURCE_ALIAS OfflineMapEditor.qml)

# qt_add_qml_module(QGCLocation
# URI QGroundControl.QGCLocation
Expand Down
Loading

0 comments on commit b822875

Please sign in to comment.