BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Describes properties of a uint value which are necessary to allow GUI representation, editing the value, undo/redo, unit conversion.
By using this class, the underlying data scheme is hidden from the user of the data. This e.g. eases SessionItem migration. The underlying implementation can be a SessionItem, a simple uint member, or any other construction to hold a uint value.
Definition at line 36 of file UIntDescriptor.h.
Public Member Functions | |
UIntDescriptor ()=default | |
UIntDescriptor (const QString &label, const uint *var, const variant< QString, Unit > &unit) | |
UIntDescriptor (const QString &label, SessionItem *item, const variant< QString, Unit > &unit) | |
Operates on a session item. The settings (like limits) are taken from the session item. Only for easier migration. Should be removed after SessionItem refactoring. More... | |
UIntDescriptor (SessionItem *item, const variant< QString, Unit > &unit) | |
Operates on a session item. The settings (like limits) are taken from the session item. Only for easier migration. Should be removed after SessionItem refactoring. More... | |
operator uint () const | |
Return the current value of the handled parameter. More... | |
Public Attributes | |
function< uint()> | get = nullptr |
function to get the current value More... | |
QString | label |
A label text (short, no trailing colon) More... | |
RealLimits | limits |
Limits of the value. More... | |
function< QString()> | path = nullptr |
Path describing this value. Used e.g. for undo/redo. More... | |
function< void(uint)> | set = nullptr |
function to set the value More... | |
QString | tooltip |
Tooltip text. More... | |
variant< QString, Unit > | unit = Unit::unitless |
Unit of the value (internal unit only!) More... | |
Private Member Functions | |
UIntDescriptor (const QString &label, const QString &tooltip, function< void(uint)> setter, function< uint()> getter, const variant< QString, Unit > &unit) | |
Operates on any kind of storage (e.g. session items), by using setter/getter methods limits is set to nonnegative. More... | |
UIntDescriptor (QString label, QString tooltip, const RealLimits &limits, function< void(uint)> setter, function< uint()> getter, const variant< QString, Unit > &unit) | |
Operates on any kind of storage (e.g. session items), by using setter/getter methods. More... | |
|
default |
UIntDescriptor::UIntDescriptor | ( | SessionItem * | item, |
const variant< QString, Unit > & | unit | ||
) |
Operates on a session item. The settings (like limits) are taken from the session item. Only for easier migration. Should be removed after SessionItem refactoring.
Definition at line 28 of file UIntDescriptor.cpp.
UIntDescriptor::UIntDescriptor | ( | const QString & | label, |
SessionItem * | item, | ||
const variant< QString, Unit > & | unit | ||
) |
Operates on a session item. The settings (like limits) are taken from the session item. Only for easier migration. Should be removed after SessionItem refactoring.
Definition at line 20 of file UIntDescriptor.cpp.
References SessionItem::setValue().
UIntDescriptor::UIntDescriptor | ( | const QString & | label, |
const uint * | var, | ||
const variant< QString, Unit > & | unit | ||
) |
Definition at line 52 of file UIntDescriptor.cpp.
|
private |
Operates on any kind of storage (e.g. session items), by using setter/getter methods.
Definition at line 40 of file UIntDescriptor.cpp.
|
private |
Operates on any kind of storage (e.g. session items), by using setter/getter methods limits is set to nonnegative.
Definition at line 33 of file UIntDescriptor.cpp.
UIntDescriptor::operator uint | ( | ) | const |
Return the current value of the handled parameter.
Definition at line 60 of file UIntDescriptor.cpp.
function<uint()> UIntDescriptor::get = nullptr |
function to get the current value
Definition at line 70 of file UIntDescriptor.h.
Referenced by GUI::Util::createSpinBox(), MinimizerSettingsWidget::createSpinbox(), and UIntProperty::init().
QString UIntDescriptor::label |
A label text (short, no trailing colon)
Definition at line 66 of file UIntDescriptor.h.
Referenced by FormLayouter::addValue(), GUI::Util::createSpinBox(), and UIntProperty::init().
RealLimits UIntDescriptor::limits |
Limits of the value.
Definition at line 68 of file UIntDescriptor.h.
Referenced by GUI::Util::createSpinBox(), MinimizerSettingsWidget::createSpinbox(), and UIntProperty::init().
function<QString()> UIntDescriptor::path = nullptr |
Path describing this value. Used e.g. for undo/redo.
Definition at line 72 of file UIntDescriptor.h.
Referenced by UIntProperty::init().
function<void(uint)> UIntDescriptor::set = nullptr |
function to set the value
Definition at line 69 of file UIntDescriptor.h.
Referenced by DistributionSelector::createSpinBox(), MinimizerSettingsWidget::createSpinbox(), UIntProperty::init(), and SampleEditorController::setInt().
QString UIntDescriptor::tooltip |
Tooltip text.
Definition at line 67 of file UIntDescriptor.h.
Referenced by GUI::Util::createSpinBox(), MinimizerSettingsWidget::createSpinbox(), and UIntProperty::init().
variant<QString, Unit> UIntDescriptor::unit = Unit::unitless |
Unit of the value (internal unit only!)
Definition at line 71 of file UIntDescriptor.h.
Referenced by GUI::Util::createSpinBox(), and UIntProperty::init().