Remoto - VFS: numberField Class Reference
Remoto - VFS

The numberField class can provide a field with up/down arrows and an optional stepped range slider. More...

#include <numberField.h>

Inheritance diagram for numberField:
VFS_form_field

Public Member Functions

 numberField (double v, QString label="", QString tip="", double min=-1, double max=-1, double step=-1)
 The double numberField constructor. More...
 
 numberField (int v, QString label="", QString tip="", int min=-1, int max=-1, int step=-1)
 The int numberField constructor. More...
 
void setRange (double min, double max, double step=1.0)
 Set a number field's range. More...
 
void setRound (QJsonValue r)
 Set the rounding decimal places for the field. More...
 
void showSlider (bool r)
 Show or hide number field's slider. More...
 
- Public Member Functions inherited from VFS_form_field
 VFS_form_field (QJsonValue val, QString type, QString label="", QString tip="")
 
 VFS_form_field (QString type)
 
void clearOption (QString o)
 Clear/remove a widget option. More...
 
int getIndex ()
 Get the field index. More...
 
QString getLabel ()
 Return the label. More...
 
void setAllowEmpty (bool e)
 Validate this field against empty-ness. More...
 
void setEnabled (bool e)
 Enable or disable this field. More...
 
void setHidden (bool e)
 Keep the field, but hide it when rendering. More...
 
void setHideLabel (bool l)
 Hide the label for this field. More...
 
void setIndex (int i)
 Set the field index for this widget. More...
 
void setLabel (QString l, bool replace=true)
 Set the label. More...
 
void setOption (QString o, QJsonValue v)
 Set a widget option. More...
 
void setSpellcheck (bool s)
 Enable or disable spellchecking on this text field. More...
 
void setTip (QString t)
 Set the tooltip. More...
 
void setValue (QJsonValue val)
 Set the value. More...
 

Additional Inherited Members

- Protected Attributes inherited from VFS_form_field
QJsonObject options
 Options for any widget type... this is an arbitrary list. More...
 

Detailed Description

The numberField class can provide a field with up/down arrows and an optional stepped range slider.

If a slider with a min or max of -1 is needed, create the object and use setRange() after.

Definition at line 6 of file numberField.h.

Constructor & Destructor Documentation

◆ numberField() [1/2]

numberField::numberField ( int  v,
QString  label = "",
QString  tip = "",
int  min = -1,
int  max = -1,
int  step = -1 
)
explicit

The int numberField constructor.

Parameters
vThe initial value
labelThe label
tipThe tooltip
minMinimum value for slider, or no slider if omitted
maxMaximum value for slider, or no slider if omitted
stepThe step for a slider, or no slider if omitted

Definition at line 22 of file numberField.cpp.

◆ numberField() [2/2]

numberField::numberField ( double  v,
QString  label = "",
QString  tip = "",
double  min = -1,
double  max = -1,
double  step = -1 
)
explicit

The double numberField constructor.

Parameters
vThe value
labelThe label
tipThe tooltip
minMinimum value for slider, or no slider if omitted
maxMaximum value for slider, or no slider if omitted
stepThe step for a slider, or no slider if omitted

Definition at line 41 of file numberField.cpp.

Member Function Documentation

◆ setRange()

void numberField::setRange ( double  min,
double  max,
double  step = 1.0 
)

Set a number field's range.

Parameters
minMinimum value
maxMaximum value
stepStep for range

Definition at line 55 of file numberField.cpp.

◆ setRound()

void numberField::setRound ( QJsonValue  r)

Set the rounding decimal places for the field.

Parameters
rThe number of places, or null to unset

Definition at line 81 of file numberField.cpp.

◆ showSlider()

void numberField::showSlider ( bool  r)

Show or hide number field's slider.

Parameters
rShow if true (default), or hide

Definition at line 67 of file numberField.cpp.


The documentation for this class was generated from the following files: