created time slider UI widget

Based on the integer slider, this can be used to interactively control time.
This commit is contained in:
itsmattkc
2019-12-08 00:11:47 +11:00
parent 2fe03debec
commit f2013a6f3d
12 changed files with 140 additions and 48 deletions
+11
View File
@@ -53,6 +53,17 @@ void FloatSlider::SetDecimalPlaces(int i)
UpdateLabel(Value());
}
QString FloatSlider::ValueToString(const QVariant &v)
{
return QString::number(v.toDouble(), 'f', decimal_places_);
}
QVariant FloatSlider::StringToValue(const QString &s, bool *ok)
{
// Allow both floats and integers for either modes
return s.toDouble(ok);
}
void FloatSlider::ConvertValue(QVariant v)
{
emit ValueChanged(v.toDouble());