created time slider UI widget
Based on the integer slider, this can be used to interactively control time.
This commit is contained in:
@@ -31,21 +31,40 @@ int IntegerSlider::GetValue()
|
||||
return Value().toInt();
|
||||
}
|
||||
|
||||
void IntegerSlider::SetValue(const int &v)
|
||||
void IntegerSlider::SetValue(const int64_t &v)
|
||||
{
|
||||
SliderBase::SetValue(v);
|
||||
}
|
||||
|
||||
void IntegerSlider::SetMinimum(const int &d)
|
||||
void IntegerSlider::SetMinimum(const int64_t &d)
|
||||
{
|
||||
SetMinimumInternal(d);
|
||||
}
|
||||
|
||||
void IntegerSlider::SetMaximum(const int &d)
|
||||
void IntegerSlider::SetMaximum(const int64_t &d)
|
||||
{
|
||||
SetMaximumInternal(d);
|
||||
}
|
||||
|
||||
QVariant IntegerSlider::StringToValue(const QString &s, bool *ok)
|
||||
{
|
||||
bool valid;
|
||||
|
||||
// Allow both floats and integers for either modes
|
||||
double decimal_val = s.toDouble(&valid);
|
||||
|
||||
if (ok) {
|
||||
*ok = valid;
|
||||
}
|
||||
|
||||
if (valid) {
|
||||
// But for an integer, we round it
|
||||
return qRound(decimal_val);
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
void IntegerSlider::ConvertValue(QVariant v)
|
||||
{
|
||||
emit ValueChanged(v.toInt());
|
||||
|
||||
Reference in New Issue
Block a user