From 3dd5866fff17ef6fb583cf8ef537299725332b0d Mon Sep 17 00:00:00 2001 From: tstellanova Date: Thu, 8 Aug 2013 23:46:58 -0700 Subject: [PATCH] refresh tree display after list recv --- src/ui/QGCParamWidget.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/ui/QGCParamWidget.cc b/src/ui/QGCParamWidget.cc index c7b75939a..d5f769b08 100644 --- a/src/ui/QGCParamWidget.cc +++ b/src/ui/QGCParamWidget.cc @@ -202,6 +202,21 @@ void QGCParamWidget::handleParameterUpdate(int componentId, const QString& param void QGCParamWidget::handleParameterListUpToDate() { + tree->collapseAll(); + + //rewrite the component item tree after receiving the full list + QMap*>::iterator i; + QMap*>* onboardParams = paramDataModel->getOnboardParameters(); + + for (i = onboardParams->begin(); i != onboardParams->end(); ++i) { + int compId = i.key(); + QMap* paramPairs = onboardParams->value(compId); + QMap::iterator j; + for (j = paramPairs->begin(); j != paramPairs->end(); j++) { + updateParameterDisplay(compId, j.key(),j.value()); + } + } + // Expand visual tree tree->expandItem(tree->topLevelItem(0)); } -- 2.22.0