diff --git a/ground/gcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp b/ground/gcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp index 3a703070b..f4177a8c4 100644 --- a/ground/gcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp +++ b/ground/gcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp @@ -190,7 +190,7 @@ void ConfigMultiRotorWidget::setupUI(QString frameType) Q_ASSERT(m_aircraft); Q_ASSERT(quad); - QList motorLabels; + QStringList motorLabels; if (frameType == "Tri" || frameType == "Tricopter Y") { setComboCurrentIndex(m_aircraft->multirotorFrameType, m_aircraft->multirotorFrameType->findText("Tricopter Y")); @@ -560,7 +560,7 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) /** Helper function to update the UI MotorPositionLabels text */ -void ConfigMultiRotorWidget::updateMotorsPositionLabels(QList motorLabels) +void ConfigMultiRotorWidget::updateMotorsPositionLabels(QStringList motorLabels) { QList mpList; mpList << m_aircraft->motorPositionLabel1 << m_aircraft->motorPositionLabel2 @@ -568,10 +568,12 @@ void ConfigMultiRotorWidget::updateMotorsPositionLabels(QList motorLabe << m_aircraft->motorPositionLabel5 << m_aircraft->motorPositionLabel6 << m_aircraft->motorPositionLabel7 << m_aircraft->motorPositionLabel8; - if (motorLabels.count() < 8) { - int motorCount = motorLabels.count(); + int motorCount = motorLabels.count(); + int uiLabelsCount = mpList.count(); + + if (motorCount < uiLabelsCount) { // Fill labels for unused motors - for (int index = motorCount; index < mpList.count(); index++) { + for (int index = motorCount; index < uiLabelsCount; index++) { motorLabels.insert(index, "Not used"); } } diff --git a/ground/gcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.h b/ground/gcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.h index 7336ef294..f38495913 100644 --- a/ground/gcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.h +++ b/ground/gcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.h @@ -79,7 +79,7 @@ private: void setYawMixLevel(int); void updateRcCurvesUsed(); void updateAirframe(QString multiRotorType); - void updateMotorsPositionLabels(QList motorLabels); + void updateMotorsPositionLabels(QStringList motorLabels); void setupEnabledControls(QString multiRotorType); private slots: