|
Krita Source Code Documentation
|
#include <KoUnitDoubleSpinBox.h>
Inheritance diagram for KoUnitDoubleSpinBox:Signals | |
| void | valueChangedPt (qreal) |
| emitted like valueChanged in the parent, but this one emits the point value | |
Public Member Functions | |
| virtual void | changeValue (double newValue) |
| KoUnitDoubleSpinBox (QWidget *parent=0) | |
| Private (double low, double up, double step) | |
| 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 points. | |
| void | setMinimum (double min) |
| Set minimum value in points. | |
| void | setMinMaxStep (double min, double max, double step) |
| Set minimum, maximum value and the step size (all in points) | |
| virtual void | setUnit (const KoUnit &) |
| QString | textFromValue (double value) const override |
| QValidator::State | validate (QString &input, int &pos) const override |
| reimplemented from superclass, will forward to KoUnitDoubleValidator | |
| double | value () const |
| double | valueFromText (const QString &str) const override |
| ~KoUnitDoubleSpinBox () override | |
Public Attributes | |
| double | lowerInPoints |
| lowest value in points | |
| double | stepInPoints |
| step in points | |
| KoUnit | unit |
| double | upperInPoints |
| highest value in points | |
Private Slots | |
| void | privateValueChanged () |
Private Attributes | |
| Private *const | d |
Private Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
Additional Inherited Members | |
Private Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
Spin box for double precision numbers with unit display. Use this widget for any value that represents a real measurable value for consistency throughout Krita. This widget shows the value in the user-selected units (inch, millimeters, etc) but keeps the Krita-widget default measurement unit internally. This has the advantage that just setting and getting a value will not change the value due to conversions. The KoDocument class has a unit() method for consistent (document wide) configuration of the used unit. It is advised to use a QDoubleSpinBox in QtDesigner and then use the context-menu item: 'Promote to Custom Widget' and use the values: 'classname=KoUnitDoubleSpinBox', 'headerfile=KoUnitDoubleSpinBox.h' This will generate code that uses this spinbox in the correct manner.
This class need to be replaced as much as possible with
Definition at line 23 of file KoUnitDoubleSpinBox.cpp.
|
explicit |
Constructor Create a new spinBox with very broad range predefined. This spinbox will have min and max borders of 10000 points and use the default unit of points.
| parent | the parent widget |
Definition at line 40 of file KoUnitDoubleSpinBox.cpp.
References connect(), KoUnit::Point, privateValueChanged(), and setUnit().
|
override |
|
virtual |
Set the new value in points which will then be converted to the current unit for display
| newValue | the new value |
Definition at line 112 of file KoUnitDoubleSpinBox.cpp.
References d.
|
inline |
Definition at line 26 of file KoUnitDoubleSpinBox.cpp.
|
privateslot |
Definition at line 120 of file KoUnitDoubleSpinBox.cpp.
References value(), and valueChangedPt().
| void KoUnitDoubleSpinBox::setLineStep | ( | double | step | ) |
Set step size in the current unit.
Definition at line 162 of file KoUnitDoubleSpinBox.cpp.
References d, KoUnit::Point, and KoUnit::toUserValue().
| void KoUnitDoubleSpinBox::setLineStepPt | ( | double | step | ) |
Set step size in points.
Definition at line 168 of file KoUnitDoubleSpinBox.cpp.
References d.
| void KoUnitDoubleSpinBox::setMaximum | ( | double | max | ) |
Set maximum value in points.
Definition at line 156 of file KoUnitDoubleSpinBox.cpp.
References d.
| void KoUnitDoubleSpinBox::setMinimum | ( | double | min | ) |
Set minimum value in points.
Definition at line 150 of file KoUnitDoubleSpinBox.cpp.
References d.
| void KoUnitDoubleSpinBox::setMinMaxStep | ( | double | min, |
| double | max, | ||
| double | step ) |
Set minimum, maximum value and the step size (all in points)
Definition at line 174 of file KoUnitDoubleSpinBox.cpp.
References setLineStepPt(), setMaximum(), and setMinimum().
This spinbox shows the internal value after a conversion to the unit set here.
Definition at line 124 of file KoUnitDoubleSpinBox.cpp.
References d, KoUnit::Pixel, KoUnit::symbol(), KoUnit::toUserValue(), KoUnit::toUserValuePrecise(), KoUnit::type(), and unit.
|
override |
Transform the double in a nice text, using locale symbols
| value | the number as double |
Definition at line 181 of file KoUnitDoubleSpinBox.cpp.
References value().
|
override |
reimplemented from superclass, will forward to KoUnitDoubleValidator
Definition at line 57 of file KoUnitDoubleSpinBox.cpp.
References d, debugWidgets, KoUnit::fromSymbol(), KoUnit::fromUserValue(), unit, value(), valueFromText(), and warnWidgets.
| double KoUnitDoubleSpinBox::value | ( | ) | const |
Definition at line 145 of file KoUnitDoubleSpinBox.cpp.
References d.
|
signal |
emitted like valueChanged in the parent, but this one emits the point value
|
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 189 of file KoUnitDoubleSpinBox.cpp.
References d.
|
private |
Definition at line 98 of file KoUnitDoubleSpinBox.h.
| double KoUnitDoubleSpinBox::lowerInPoints |
lowest value in points
Definition at line 34 of file KoUnitDoubleSpinBox.cpp.
| double KoUnitDoubleSpinBox::stepInPoints |
step in points
Definition at line 36 of file KoUnitDoubleSpinBox.cpp.
| KoUnit KoUnitDoubleSpinBox::unit |
Definition at line 37 of file KoUnitDoubleSpinBox.cpp.
| double KoUnitDoubleSpinBox::upperInPoints |
highest value in points
Definition at line 35 of file KoUnitDoubleSpinBox.cpp.