1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +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> <enum>QTabWidget::North</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<property name="documentMode"> <property name="documentMode">
<bool>true</bool> <bool>true</bool>
@ -11673,7 +11673,7 @@ border-radius: 4;
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>-38</y> <y>0</y>
<width>626</width> <width>626</width>
<height>828</height> <height>828</height>
</rect> </rect>

View File

@ -264,6 +264,7 @@ void ConfigTaskWidget::refreshWidgetsValues()
else else
{ {
setWidgetFromField(ow->widget,ow->field,ow->index,ow->scale,ow->isLimited); setWidgetFromField(ow->widget,ow->field,ow->index,ow->scale,ow->isLimited);
} }
} }
@ -346,6 +347,25 @@ void ConfigTaskWidget::enableControls(bool enable)
button->setEnabled(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 * SLOT function called when on of the widgets contents added to the framework changes
*/ */
@ -664,6 +684,15 @@ void ConfigTaskWidget::autoLoadWidgets()
} }
} }
refreshWidgetsValues(); 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 * Adds a widget to a list of default/reload groups

View File

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