|
|
|
@ -53,8 +53,8 @@ int FactValueSliderListModel::resetInitialValue(void)
@@ -53,8 +53,8 @@ int FactValueSliderListModel::resetInitialValue(void)
|
|
|
|
|
} else { |
|
|
|
|
_increment = _fact.cookedIncrement(); |
|
|
|
|
} |
|
|
|
|
_cPrevValues = qMin((_initialValue - _fact.cookedMin().toDouble()), 1000.0) / _increment; |
|
|
|
|
_cNextValues = qMin((_fact.cookedMax().toDouble() - _initialValue), 1000.0) / _increment; |
|
|
|
|
_cPrevValues = qMin((_initialValue - _fact.cookedMin().toDouble()), 100.0) / _increment; |
|
|
|
|
_cNextValues = qMin((_fact.cookedMax().toDouble() - _initialValue), 100.0) / _increment; |
|
|
|
|
_initialValueIndex = _cPrevValues; |
|
|
|
|
|
|
|
|
|
int totalValueCount = _cPrevValues + 1 + _cNextValues; |
|
|
|
@ -62,6 +62,8 @@ int FactValueSliderListModel::resetInitialValue(void)
@@ -62,6 +62,8 @@ int FactValueSliderListModel::resetInitialValue(void)
|
|
|
|
|
_cValues = totalValueCount; |
|
|
|
|
endInsertRows(); |
|
|
|
|
|
|
|
|
|
emit initialValueAtPrecisionChanged(); |
|
|
|
|
|
|
|
|
|
return _initialValueIndex; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -126,3 +128,9 @@ int FactValueSliderListModel::valueIndexAtModelIndex(int index)
@@ -126,3 +128,9 @@ int FactValueSliderListModel::valueIndexAtModelIndex(int index)
|
|
|
|
|
{ |
|
|
|
|
return data(createIndex(index, 0), _valueIndexRole).toInt(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
double FactValueSliderListModel::initialValueAtPrecision(void) |
|
|
|
|
{ |
|
|
|
|
double precision = qPow(10, _fact.decimalPlaces()); |
|
|
|
|
return qRound(_initialValue * precision) / precision; |
|
|
|
|
} |
|
|
|
|