VectorInput
The shared base of the vector parameter inputs.
| Declared in | src/libs/libwidgets/components/VectorInput.hpp |
| Inherits | QWidget |
| Inherited By | Vec2Input, Vec3Input, and Vec4Input |
| Group | libwidgets |
Detailed description
Vec2Input, Vec3Input and Vec4Input were three copies of one class, and the copies drifted: only Vec3Input relayed the stroke signals (D1), and none passed snapTypedEntry (D2) (vector-drag-number §VNF-2). VectorInput holds what they shared: the label, one DragNumber of 2 to 4 components drawn as <x, y, z> with the unit once, the reset button, the config, and the signals (§VND-7).
ParameterInputRow finds the name as the first direct child QLabel and hides the reset button by its text, so both stay as they were.
See also DragNumber, Vec3Input.
Member function documentation
VectorInput
[protected] VectorInput::VectorInput(const ParameterInputConfig &config, int count, QWidget *parent)
Creates a vector input of count components from config, with parent.
componentValue
double VectorInput::componentValue(int component) const
Returns the value of component, or 0 for an index out of range.
See also setComponentValue().
resetToDefault
void VectorInput::resetToDefault()
Sets every component to the default and emits componentChanged for each.
setComponentValue
void VectorInput::setComponentValue(int component, double value)
Sets component to value with no signal (§OPR-3b).
See also componentValue().
setLabelWidth
void VectorInput::setLabelWidth(int width)
Sets the width of the name label to width.
setValues
[protected] void VectorInput::setValues(const QList<double> &values)
Sets every component from values with no signal, and one repaint.