1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-03 11:24:10 +01:00

OP-1331 fixed regression in widget binding framework (handling of scale was broken)

This commit is contained in:
Philippe Renon 2014-05-14 23:37:40 +02:00
parent b74e1c19bf
commit ced787d716

View File

@ -406,24 +406,23 @@ void ConfigTaskWidget::widgetsContentsChanged()
{ {
QWidget *emitter = ((QWidget *)sender()); QWidget *emitter = ((QWidget *)sender());
emit widgetContentsChanged(emitter); emit widgetContentsChanged(emitter);
double scale = 1.0;
QVariant value; QVariant value;
foreach(WidgetBinding * binding, m_widgetBindingsPerWidget.values(emitter)) { foreach(WidgetBinding * binding, m_widgetBindingsPerWidget.values(emitter)) {
if (binding && binding->isEnabled()) { if (binding && binding->isEnabled()) {
if (binding->widget() == emitter) { if (binding->widget() == emitter) {
checkWidgetsLimits(emitter, binding->field(), binding->index(), binding->isLimited(), value = getVariantFromWidget(emitter, binding);
getVariantFromWidget(emitter, binding), binding->scale()); checkWidgetsLimits(emitter, binding->field(), binding->index(), binding->isLimited(), value, binding->scale());
} else { } else {
foreach(ShadowWidgetBinding * shadow, binding->shadows()) { foreach(ShadowWidgetBinding * shadow, binding->shadows()) {
if (shadow->widget() == emitter) { if (shadow->widget() == emitter) {
WidgetBinding tmpBinding(shadow->widget(), binding->object(), binding->field(), binding->index(), shadow->scale(), shadow->isLimited()); WidgetBinding tmpBinding(shadow->widget(), binding->object(), binding->field(),
QVariant value = getVariantFromWidget(emitter, &tmpBinding); binding->index(), shadow->scale(), shadow->isLimited());
checkWidgetsLimits(emitter, binding->field(), binding->index(), shadow->isLimited(), value, scale); value = getVariantFromWidget(emitter, &tmpBinding);
checkWidgetsLimits(emitter, binding->field(), binding->index(), shadow->isLimited(), value, shadow->scale());
} }
} }
} }
value = getVariantFromWidget(emitter, binding);
binding->setValue(value); binding->setValue(value);
if (binding->widget() != emitter) { if (binding->widget() != emitter) {