reimplemented updating UI from effect fields
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#include "combofield.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#include "ui/comboboxex.h"
|
||||
|
||||
ComboField::ComboField(EffectRow* parent, const QString& id) :
|
||||
@@ -32,6 +34,24 @@ QWidget *ComboField::CreateWidget()
|
||||
return cb;
|
||||
}
|
||||
|
||||
void ComboField::UpdateWidgetValue(QWidget *widget, double timecode)
|
||||
{
|
||||
QVariant data = GetValueAt(timecode);
|
||||
|
||||
ComboBoxEx* cb = static_cast<ComboBoxEx*>(widget);
|
||||
|
||||
for (int i=0;i<items_.size();i++) {
|
||||
if (items_.at(i).data == data) {
|
||||
cb->blockSignals(true);
|
||||
cb->setCurrentIndex(i);
|
||||
cb->blockSignals(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
qWarning() << "Failed to set ComboField value from data";
|
||||
}
|
||||
|
||||
void ComboField::UpdateFromWidget(int index)
|
||||
{
|
||||
SetValueAt(Now(), items_.at(index).data);
|
||||
|
||||
Reference in New Issue
Block a user