reimplemented double and bool widgets separately

This commit is contained in:
itsmattkc
2019-03-13 00:12:15 +11:00
parent 5b03af5e5a
commit e3e45279b9
36 changed files with 327 additions and 312 deletions
+29 -5
View File
@@ -2,8 +2,11 @@
DoubleField::DoubleField(EffectRow* parent, const QString& id) :
EffectField(parent, id, EFFECT_FIELD_DOUBLE),
min_(DBL_MIN),
max_(DBL_MAX),
min_(qSNaN()),
max_(qSNaN()),
default_(0),
display_type_(LabelSlider::LABELSLIDER_NORMAL),
frame_rate_(30),
value_set_(false)
{
connect(this, SIGNAL(Changed()), this, SLOT(ValueHasBeenSet()), Qt::DirectConnection);
@@ -54,12 +57,33 @@ QString DoubleField::ConvertValueToString(const QVariant &v)
return QString::number(v.toDouble());
}
//QWidget *DoubleField::CreateWidget()
//{
QWidget *DoubleField::CreateWidget()
{
LabelSlider* ls = new LabelSlider();
//}
if (!qIsNaN(min_)) {
ls->set_minimum_value(min_);
}
ls->set_default_value(default_);
if (!qIsNaN(max_)) {
ls->set_maximum_value(max_);
}
ls->set_display_type(display_type_);
ls->set_frame_rate(frame_rate_);
connect(ls, SIGNAL(valueChanged(double)), this, SLOT(UpdateFromWidget(double)));
connect(ls, SIGNAL(clicked()), this, SIGNAL(Clicked()));
connect(this, SIGNAL(EnabledChanged(bool)), ls, SLOT(setEnabled(bool)));
return ls;
}
void DoubleField::ValueHasBeenSet()
{
value_set_ = true;
}
void DoubleField::UpdateFromWidget(double d)
{
SetValueAt(Now(), d);
}