Remoto - VFS: groupField Class Reference
Remoto - VFS

The groupField class adds a field group to a form. More...

#include <groupField.h>

Inheritance diagram for groupField:
VFS_form_field eulerField vector3Field

Public Member Functions

 groupField (QJsonObject v, QString label="", QString tip="")
 Use this constructor when fields have already been constructed. More...
 
 groupField (QString label="", QString tip="")
 Use this constructor when you plan to add fields later. More...
 
void addField (QString name, VFS_form_field value, int index=-1)
 Add a VFS_form_field to a group at an index. More...
 
void setEqual (bool e)
 Group fields can force children to have equal size. 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...
 

Public Attributes

QJsonObject _children
 The group's children. More...
 
int _index
 Autoindex value for added fields. 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 groupField class adds a field group to a form.

The field group will need to have fields added using addField(). The value of a group is a json object aggregate of its members.

The fields are autoindexed unless addField is used with an index specifier. When rendered, fields will be sorted by index, as JSON does not maintain key order when serializing.

Note
A group field should be appended to a form once all members have been added.

Definition at line 6 of file groupField.h.

Constructor & Destructor Documentation

◆ groupField() [1/2]

groupField::groupField ( QJsonObject  v,
QString  label = "",
QString  tip = "" 
)
explicit

Use this constructor when fields have already been constructed.

Parameters
vA JSON object containing name:field values
labelThe label
tipThe tooltip

Definition at line 29 of file groupField.cpp.

◆ groupField() [2/2]

groupField::groupField ( QString  label = "",
QString  tip = "" 
)
explicit

Use this constructor when you plan to add fields later.

Parameters
labelThe label
tipThe tooltip

Definition at line 42 of file groupField.cpp.

Member Function Documentation

◆ addField()

void groupField::addField ( QString  name,
VFS_form_field  field,
int  index = -1 
)

Add a VFS_form_field to a group at an index.

Parameters
nameThe field name
fieldThe field
indexThe field index, which if omitted will be autoindexed

Definition at line 55 of file groupField.cpp.

◆ setEqual()

void groupField::setEqual ( bool  e)

Group fields can force children to have equal size.

Parameters
eWhether or not to force equal sizing

Definition at line 72 of file groupField.cpp.

Member Data Documentation

◆ _children

QJsonObject groupField::_children

The group's children.

Definition at line 15 of file groupField.h.

◆ _index

int groupField::_index

Autoindex value for added fields.

Definition at line 16 of file groupField.h.


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