diff --git a/src/AutoPilotPlugins/Common/RadioComponent.qml b/src/AutoPilotPlugins/Common/RadioComponent.qml index a6bef66e7444533f0ccd48ab370b2fd6346de271..75e038a5eea02b0de993f3aebcd285d7afff5a3e 100644 --- a/src/AutoPilotPlugins/Common/RadioComponent.qml +++ b/src/AutoPilotPlugins/Common/RadioComponent.qml @@ -18,6 +18,7 @@ import QGroundControl.FactControls 1.0 import QGroundControl.Controls 1.0 import QGroundControl.ScreenTools 1.0 import QGroundControl.Controllers 1.0 +import QGroundControl.Palette 1.0 SetupPage { id: radioPage @@ -48,6 +49,8 @@ SetupPage { { } + QGCPalette { id: qgcPal; colorGroupEnabled: radioPage.enabled } + RadioComponentController { id: controller factPanel: radioPage.viewPanel diff --git a/src/qgcunittest/RadioConfigTest.cc b/src/qgcunittest/RadioConfigTest.cc index e06e21e8c2fbe07a24d9fdc497fb295b9c490abf..edcf97fbe50d2cb05830ef7ded3621e73279021d 100644 --- a/src/qgcunittest/RadioConfigTest.cc +++ b/src/qgcunittest/RadioConfigTest.cc @@ -12,6 +12,9 @@ #include "RadioComponentController.h" #include "MultiVehicleManager.h" #include "QGCApplication.h" +#include "PX4/PX4AutoPilotPlugin.h" +#include "APM/APMAutoPilotPlugin.h" +#include "APM/APMRadioComponent.h" /// @file /// @brief QRadioComponentController Widget unit test @@ -200,6 +203,13 @@ void RadioConfigTest::_init(MAV_AUTOPILOT firmwareType) _calWidget->resize(600, 600); Q_CHECK_PTR(_calWidget); _calWidget->setAutoPilot(_autopilot); + QObject* vehicleComponent; + if (firmwareType == MAV_AUTOPILOT_PX4) { + vehicleComponent = dynamic_cast(dynamic_cast(_autopilot)->radioComponent()); + } else { + vehicleComponent = dynamic_cast(dynamic_cast(_autopilot)->radioComponent()); + } + _calWidget->setContextPropertyObject("vehicleComponent", vehicleComponent); _calWidget->setSource(QUrl::fromUserInput("qrc:/qml/RadioComponent.qml")); // Nasty hack to get to controller