1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Fixes shadow widgets values not being refreshed if master widget default value is equal the the UAVObj field value.

This commit is contained in:
zedamota 2012-02-18 16:58:10 +00:00
parent 353fe8b349
commit 949785d212
3 changed files with 32 additions and 2 deletions

View File

@ -470,7 +470,7 @@
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<property name="documentMode">
<bool>true</bool>
@ -11673,7 +11673,7 @@ border-radius: 4;
<property name="geometry">
<rect>
<x>0</x>
<y>-38</y>
<y>0</y>
<width>626</width>
<height>828</height>
</rect>

View File

@ -264,6 +264,7 @@ void ConfigTaskWidget::refreshWidgetsValues()
else
{
setWidgetFromField(ow->widget,ow->field,ow->index,ow->scale,ow->isLimited);
}
}
@ -346,6 +347,25 @@ void ConfigTaskWidget::enableControls(bool enable)
button->setEnabled(enable);
}
}
/**
* SLOT function called when on of the widgets contents added to the framework changes
*/
void ConfigTaskWidget::forceShadowUpdates()
{
foreach(objectToWidget * oTw,objOfInterest)
{
foreach (shadow * sh, oTw->shadowsList)
{
disconnectWidgetUpdatesToSlot((QWidget*)sh->widget,SLOT(widgetsContentsChanged()));
checkWidgetsLimits(sh->widget,oTw->field,oTw->index,sh->isLimited,getVariantFromWidget(oTw->widget,oTw->scale),sh->scale);
setWidgetFromVariant(sh->widget,getVariantFromWidget(oTw->widget,oTw->scale),sh->scale);
emit widgetContentsChanged((QWidget*)sh->widget);
connectWidgetUpdatesToSlot((QWidget*)sh->widget,SLOT(widgetsContentsChanged()));
}
}
setDirty(true);
}
/**
* SLOT function called when on of the widgets contents added to the framework changes
*/
@ -664,6 +684,15 @@ void ConfigTaskWidget::autoLoadWidgets()
}
}
refreshWidgetsValues();
forceShadowUpdates();
foreach(objectToWidget * ow,objOfInterest)
{
qDebug()<<"Master:"<<ow->widget->objectName();
foreach(shadow * sh,ow->shadowsList)
{
qDebug()<<"Child"<<sh->widget->objectName();
}
}
}
/**
* Adds a widget to a list of default/reload groups

View File

@ -115,6 +115,7 @@ public:
bool allObjectsUpdated();
void setOutOfLimitsStyle(QString style){outOfLimitsStyle=style;}
void addHelpButton(QPushButton * button,QString url);
void forceShadowUpdates();
public slots:
void onAutopilotDisconnect();
void onAutopilotConnect();