22 const RealLimits& limits_,
function<
void(
double)> setter,
23 function<
double()> getter,
const variant<QString, Unit>& unit_)
24 : label(std::move(label_))
25 , tooltip(std::move(tooltip_))
28 , set(std::move(setter))
29 , get(std::move(getter))
34 path = [] {
return QString(); };
38 function<
void(
double)> setter,
function<
double()> getter,
39 const variant<QString, Unit>& unit)
40 :
DoubleDescriptor(label, tooltip, 3, RealLimits::nonnegative(), setter, getter, unit)
45 const variant<QString, Unit>& unit)
52 const RealLimits& limits,
double* var,
53 const variant<QString, Unit>& unit)
55 label, tooltip, decimals, limits, [=](double v) { *var = v; }, [=] {
return *var; }, unit)
60 const variant<QString, Unit>& unit)
62 label,
"", 3, RealLimits::nonnegative(), [=](double v) { *
const_cast<double*
>(var) = v; },
63 [=] {
return *var; }, unit)
68 const variant<QString, Unit>& unit)
70 label, item->toolTip(), item->decimals(), item->limits(),
71 [=](double d) { item->
setValue(d); }, [=]() {
return item->value().toDouble(); }, unit)
74 ASSERT(item->model());
84 DoubleDescriptor::operator double()
const
Defines class DoubleDescriptor.
Defines class Helpers functions.
Defines class SessionItem.
Defines class SessionModel.
Describes properties of a double value which are necessary to allow GUI representation,...
DoubleDescriptor()=default
function< QString()> path
Path describing this value. Used e.g. for undo/redo.
Base class for a GUI data item.
bool setValue(QVariant value)
Set value, ensure that variant types match.
QString getPathFromIndex(const QModelIndex &index)