|
Krita Source Code Documentation
|
The KisDoubleParseUnitSpinBox class is an evolution of the. More...
#include <kis_double_parse_unit_spin_box.h>
Inheritance diagram for KisDoubleParseUnitSpinBox:Signals | |
| void | valueChangedPt (qreal) |
| emitted like valueChanged in the parent, but this one emits the point value, or converted to another reference unit. | |
Signals inherited from KisDoubleParseSpinBox | |
| void | errorWhileParsing (const QString &expr) const |
| signal emitted when the last parsed expression is not valid. | |
| void | noMoreParsingError () const |
| signal emitted when the last parsed expression is valid and the expression before was not valid. | |
Public Member Functions | |
| virtual void | changeValue (double newValue) |
| void | changeValuePt (double newValue) |
| KisDoubleParseUnitSpinBox (QWidget *parent=0) | |
| void | preventDecimalsChangeFromUnitManager (bool prevent) |
| Private (double low, double up, double step, KisSpinBoxUnitManager *unitManager) | |
| QString | returnUnit () const |
| returnUnit returns the unit in which values are returned | |
| void | setDecimals (int prec) |
| virtual void | setDimensionType (int dim) |
| setDimensionType set the dimension (for example length or angle) of the units the spinbox manage | |
| void | setDisplayUnit (bool toggle) |
| display the unit symbol in the spinbox or not. For example if the unit is displayed in a combobox connected to the unit manager. | |
| void | setLineStep (double step) |
| Set step size in the current unit. | |
| void | setLineStepPt (double step) |
| Set step size in points. | |
| void | setMaximum (double max) |
| Set maximum value in current unit. | |
| void | setMaximumPt (double max) |
| Set maximum value in points. | |
| void | setMinimum (double min) |
| Set minimum value in current unit. | |
| void | setMinimumPt (double min) |
| Set minimum value in points. | |
| void | setMinMaxStep (double min, double max, double step) |
| Set minimum, maximum value and the step size (in current unit) | |
| void | setMinMaxStepPt (double min, double max, double step) |
| Set minimum, maximum value and the step size (all in points) | |
| void | setReturnUnit (const QString &symbol) |
| setReturnUnit set a unit, such that the spinbox now return values in this unit instead of the reference unit for the current dimension. | |
| void | setSingleStep (double val) |
| virtual void | setUnit (const KoUnit &unit) |
| virtual void | setUnit (const QString &symbol) |
| void | setUnitChangeFromOutsideBehavior (bool toggle) |
| void | setUnitManager (KisSpinBoxUnitManager *unitManager) |
| QString | textFromValue (double value) const override |
| double | value () const |
| double | valueFromText (const QString &str) const override |
| double | valuePt () const |
| QString | veryCleanText () const override |
| get the text in the spinbox without prefix or suffix, and remove unit symbol if present. | |
| ~KisDoubleParseUnitSpinBox () override | |
Public Member Functions inherited from KisDoubleParseSpinBox | |
| bool | isLastValid () const |
| Get if the last expression entered is a valid one. | |
| KisDoubleParseSpinBox (QWidget *parent=0) | |
| void | setValue (double value, bool overwriteExpression=false) |
| Set the value of the spinbox. | |
| void | stepBy (int steps) override |
| This is a reimplementation of QDoubleSpinBox::stepBy that uses setValue. | |
| ~KisDoubleParseSpinBox () override | |
Public Attributes | |
| bool | allowResetDecimals {true} |
| KisSpinBoxUnitManager * | defaultUnitManager {0} |
| bool | displayUnit {true} |
| bool | isDeleting {false} |
| bool | letUnitBeChangedFromOutsideMoreThanOnce {true} |
| double | lowerInPoints {0.0} |
| minimum precision for given decimals | |
| double | minStepForPrec {0} |
| bool | mustUsePreviousText {false} |
| QString | outPutSymbol |
| QString | previousSymbol |
| double | previousValueInPoint {0.0} |
| allow to store the previous value in point, useful in some cases, even if, usually, we prefer to refer to the actual value (in selected unit) and convert it, since this is not always updated. | |
| double | stepInPoints {0.0} |
| step in points | |
| KoUnit | unit |
| bool | unitHasBeenChangedFromOutSideOnce {false} |
| KisSpinBoxUnitManager * | unitManager {0} |
| double | upperInPoints {0.0} |
| highest value in points | |
Private Slots | |
| void | detectUnitChanges () |
| void | disconnectExternalUnitManager () |
| void | privateValueChanged () |
Private Member Functions | |
| void | contextMenuEvent (QContextMenuEvent *event) override |
| QString | detectUnit () |
| void | internalUnitChange (QString const &symbol) |
| change the unit, reset the spin box every time. From the outside it's always set unit that should be called. | |
| QString | makeTextClean (QString const &txt) const |
| void | prepareUnitChange () |
Private Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
Private Attributes | |
| Private *const | d |
Private Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
Additional Inherited Members | |
Protected Member Functions inherited from KisDoubleParseSpinBox | |
| QString | textFromValue (double value) const override |
| QValidator::State | validate (QString &input, int &pos) const override |
| double | valueFromText (const QString &text) const override |
The KisDoubleParseUnitSpinBox class is an evolution of the.
This class store the
Definition at line 20 of file kis_double_parse_unit_spin_box.cpp.
| KisDoubleParseUnitSpinBox::KisDoubleParseUnitSpinBox | ( | QWidget * | parent = 0 | ) |
Definition at line 59 of file kis_double_parse_unit_spin_box.cpp.
References connect(), d, detectUnitChanges(), internalUnitChange(), KoUnit::Point, prepareUnitChange(), privateValueChanged(), setDecimals(), setUnit(), KisSpinBoxUnitManager::unitAboutToChange(), KisSpinBoxUnitManager::unitChanged(), and void().
|
override |
|
virtual |
Set the new value in points (or other reference unit) which will then be converted to the current unit for display
| newValue | the new value |
Definition at line 155 of file kis_double_parse_unit_spin_box.cpp.
References d, and KisDoubleParseSpinBox::setValue().
| void KisDoubleParseUnitSpinBox::changeValuePt | ( | double | newValue | ) |
Set the new value in points whatever is the reference unit for display
| newValue | the new value |
Definition at line 182 of file kis_double_parse_unit_spin_box.cpp.
References d, and KisDoubleParseSpinBox::setValue().
|
overrideprivate |
Definition at line 476 of file kis_double_parse_unit_spin_box.cpp.
References KisSpinBoxUnitManager::ANGLE, d, KoUnit::fromSymbol(), KisSpinBoxUnitManager::IMLENGTH, KisSpinBoxUnitManager::LENGTH, KisDoubleParseSpinBox::stepBy(), KisSpinBoxUnitManager::TIME, and KoUnit::unitDescription().
|
private |
Definition at line 383 of file kis_double_parse_unit_spin_box.cpp.
References veryCleanText().
|
privateslot |
Definition at line 399 of file kis_double_parse_unit_spin_box.cpp.
References d, detectUnit(), setUnit(), setUnitChangeFromOutsideBehavior(), KisDoubleParseSpinBox::setValue(), and valueFromText().
|
privateslot |
Definition at line 447 of file kis_double_parse_unit_spin_box.cpp.
References d, and setUnitManager().
|
private |
change the unit, reset the spin box every time. From the outside it's always set unit that should be called.
Definition at line 228 of file kis_double_parse_unit_spin_box.cpp.
References d, KoUnit::Pixel, setDecimals(), setSingleStep(), and KisDoubleParseSpinBox::setValue().
|
private |
Definition at line 429 of file kis_double_parse_unit_spin_box.cpp.
References d.
|
private |
| void KisDoubleParseUnitSpinBox::preventDecimalsChangeFromUnitManager | ( | bool | prevent | ) |
Definition at line 373 of file kis_double_parse_unit_spin_box.cpp.
References d.
|
inline |
Definition at line 23 of file kis_double_parse_unit_spin_box.cpp.
|
privateslot |
Definition at line 378 of file kis_double_parse_unit_spin_box.cpp.
References value(), and valueChangedPt().
| QString KisDoubleParseUnitSpinBox::returnUnit | ( | ) | const |
returnUnit returns the unit in which values are returned
Definition at line 217 of file kis_double_parse_unit_spin_box.cpp.
References d.
| void KisDoubleParseUnitSpinBox::setDecimals | ( | int | prec | ) |
Definition at line 460 of file kis_double_parse_unit_spin_box.cpp.
References d, and setSingleStep().
|
virtual |
setDimensionType set the dimension (for example length or angle) of the units the spinbox manage
| dim | the dimension id. (if not an id in KisSpinBoxUnitManager::UnitDimension, then the function does nothing). |
Definition at line 256 of file kis_double_parse_unit_spin_box.cpp.
References d, and KisSpinBoxUnitManager::isUnitId().
| void KisDoubleParseUnitSpinBox::setDisplayUnit | ( | bool | toggle | ) |
display the unit symbol in the spinbox or not. For example if the unit is displayed in a combobox connected to the unit manager.
Definition at line 368 of file kis_double_parse_unit_spin_box.cpp.
References d.
| void KisDoubleParseUnitSpinBox::setLineStep | ( | double | step | ) |
Set step size in the current unit.
Definition at line 308 of file kis_double_parse_unit_spin_box.cpp.
References d.
| void KisDoubleParseUnitSpinBox::setLineStepPt | ( | double | step | ) |
Set step size in points.
Definition at line 314 of file kis_double_parse_unit_spin_box.cpp.
References d.
| void KisDoubleParseUnitSpinBox::setMaximum | ( | double | max | ) |
Set maximum value in current unit.
Definition at line 296 of file kis_double_parse_unit_spin_box.cpp.
References d.
| void KisDoubleParseUnitSpinBox::setMaximumPt | ( | double | max | ) |
Set maximum value in points.
Definition at line 302 of file kis_double_parse_unit_spin_box.cpp.
References d.
| void KisDoubleParseUnitSpinBox::setMinimum | ( | double | min | ) |
Set minimum value in current unit.
Definition at line 283 of file kis_double_parse_unit_spin_box.cpp.
References d.
| void KisDoubleParseUnitSpinBox::setMinimumPt | ( | double | min | ) |
Set minimum value in points.
Definition at line 289 of file kis_double_parse_unit_spin_box.cpp.
References d.
| void KisDoubleParseUnitSpinBox::setMinMaxStep | ( | double | min, |
| double | max, | ||
| double | step ) |
Set minimum, maximum value and the step size (in current unit)
Definition at line 320 of file kis_double_parse_unit_spin_box.cpp.
References setLineStep(), setMaximum(), and setMinimum().
| void KisDoubleParseUnitSpinBox::setMinMaxStepPt | ( | double | min, |
| double | max, | ||
| double | step ) |
Set minimum, maximum value and the step size (all in points)
Definition at line 327 of file kis_double_parse_unit_spin_box.cpp.
References setLineStepPt(), setMaximumPt(), and setMinimumPt().
| void KisDoubleParseUnitSpinBox::setReturnUnit | ( | const QString & | symbol | ) |
setReturnUnit set a unit, such that the spinbox now return values in this unit instead of the reference unit for the current dimension.
| symbol | the symbol of the new unit. |
Definition at line 212 of file kis_double_parse_unit_spin_box.cpp.
References d.
| void KisDoubleParseUnitSpinBox::setSingleStep | ( | double | val | ) |
Definition at line 469 of file kis_double_parse_unit_spin_box.cpp.
References d.
This spinbox shows the internal value after a conversion to the unit set here.
Definition at line 193 of file kis_double_parse_unit_spin_box.cpp.
References d, KisSpinBoxUnitManager::LENGTH, setUnit(), KoUnit::symbol(), and unit.
|
virtual |
Definition at line 207 of file kis_double_parse_unit_spin_box.cpp.
References d.
| void KisDoubleParseUnitSpinBox::setUnitChangeFromOutsideBehavior | ( | bool | toggle | ) |
Definition at line 363 of file kis_double_parse_unit_spin_box.cpp.
References d.
| void KisDoubleParseUnitSpinBox::setUnitManager | ( | KisSpinBoxUnitManager * | unitManager | ) |
Definition at line 83 of file kis_double_parse_unit_spin_box.cpp.
References connect(), d, disconnectExternalUnitManager(), KisSpinBoxUnitManager::getApparentUnitSymbol(), KisSpinBoxUnitManager::getReferenceValue(), KisSpinBoxUnitManager::getUnitDimensionType(), internalUnitChange(), KoUnit::Pixel, prepareUnitChange(), setDecimals(), KisDoubleParseSpinBox::setValue(), KisSpinBoxUnitManager::unitAboutToChange(), KisSpinBoxUnitManager::unitChanged(), unitManager, and void().
|
override |
Transform the double in a nice text, using locale symbols
| value | the number as double |
Definition at line 335 of file kis_double_parse_unit_spin_box.cpp.
References d, KisDoubleParseSpinBox::textFromValue(), and value().
| double KisDoubleParseUnitSpinBox::value | ( | ) | const |
Definition at line 265 of file kis_double_parse_unit_spin_box.cpp.
References d.
|
signal |
emitted like valueChanged in the parent, but this one emits the point value, or converted to another reference unit.
|
override |
Transform a string into a double, while taking care of locale specific symbols.
| str | the string to transform into a number |
Definition at line 356 of file kis_double_parse_unit_spin_box.cpp.
References makeTextClean(), and KisDoubleParseSpinBox::valueFromText().
| double KisDoubleParseUnitSpinBox::valuePt | ( | ) | const |
Definition at line 278 of file kis_double_parse_unit_spin_box.cpp.
References d.
|
overridevirtual |
get the text in the spinbox without prefix or suffix, and remove unit symbol if present.
Reimplemented from KisDoubleParseSpinBox.
Definition at line 351 of file kis_double_parse_unit_spin_box.cpp.
References makeTextClean().
| bool KisDoubleParseUnitSpinBox::allowResetDecimals {true} |
Definition at line 54 of file kis_double_parse_unit_spin_box.cpp.
|
private |
Definition at line 138 of file kis_double_parse_unit_spin_box.h.
| KisSpinBoxUnitManager* KisDoubleParseUnitSpinBox::defaultUnitManager {0} |
Definition at line 45 of file kis_double_parse_unit_spin_box.cpp.
| bool KisDoubleParseUnitSpinBox::displayUnit {true} |
Definition at line 52 of file kis_double_parse_unit_spin_box.cpp.
| bool KisDoubleParseUnitSpinBox::isDeleting {false} |
Definition at line 47 of file kis_double_parse_unit_spin_box.cpp.
| bool KisDoubleParseUnitSpinBox::letUnitBeChangedFromOutsideMoreThanOnce {true} |
Definition at line 50 of file kis_double_parse_unit_spin_box.cpp.
| double KisDoubleParseUnitSpinBox::lowerInPoints {0.0} |
minimum precision for given decimals
lowest value in points
Definition at line 35 of file kis_double_parse_unit_spin_box.cpp.
| double KisDoubleParseUnitSpinBox::minStepForPrec {0} |
Definition at line 34 of file kis_double_parse_unit_spin_box.cpp.
| bool KisDoubleParseUnitSpinBox::mustUsePreviousText {false} |
Definition at line 56 of file kis_double_parse_unit_spin_box.cpp.
| QString KisDoubleParseUnitSpinBox::outPutSymbol |
Definition at line 42 of file kis_double_parse_unit_spin_box.cpp.
| QString KisDoubleParseUnitSpinBox::previousSymbol |
Definition at line 41 of file kis_double_parse_unit_spin_box.cpp.
| double KisDoubleParseUnitSpinBox::previousValueInPoint {0.0} |
allow to store the previous value in point, useful in some cases, even if, usually, we prefer to refer to the actual value (in selected unit) and convert it, since this is not always updated.
Definition at line 40 of file kis_double_parse_unit_spin_box.cpp.
| double KisDoubleParseUnitSpinBox::stepInPoints {0.0} |
| KoUnit KisDoubleParseUnitSpinBox::unit |
Definition at line 38 of file kis_double_parse_unit_spin_box.cpp.
| bool KisDoubleParseUnitSpinBox::unitHasBeenChangedFromOutSideOnce {false} |
Definition at line 49 of file kis_double_parse_unit_spin_box.cpp.
| KisSpinBoxUnitManager* KisDoubleParseUnitSpinBox::unitManager {0} |
Definition at line 44 of file kis_double_parse_unit_spin_box.cpp.
| double KisDoubleParseUnitSpinBox::upperInPoints {0.0} |