Remoto - VFS: VFS_form_field.h Source File
Remoto - VFS
VFS_form_field.h
Go to the documentation of this file.
1 #ifndef VFS_FORM_FIELD_H
2 #define VFS_FORM_FIELD_H
3 
4 #include <QJsonObject>
5 
6 class VFS_form_field : public QJsonObject
7 {
8  public:
9  explicit VFS_form_field(QString type);
10  explicit VFS_form_field(QJsonValue val, QString type, QString label="", QString tip="");
11 
12  void setValue(QJsonValue val);
13  void setLabel(QString l, bool replace=true);
14  QString getLabel();
15  void setTip(QString t);
16  void setIndex(int i);
17  int getIndex();
18  void setOption(QString o, QJsonValue v);
19  void clearOption(QString o);
20 
21  void setAllowEmpty(bool e);
22  void setEnabled(bool e);
23  void setHidden(bool e);
24  void setHideLabel(bool l);
25  void setSpellcheck(bool s);
26  // void setInclude(bool i);
27 
28  // bool _include; //whether or not to save (include) this field value in subclassDocument
29 
30  //void append(QString name, VFS_form_field field);
31  //void remove(QString name);
32 
33  protected:
34  QJsonObject options;
35 };
36 
37 
38 #endif // VFS_FORM_FIELD_H
39 
Base class for all form field types.
Definition: VFS_form_field.h:7
void setEnabled(bool e)
Enable or disable this field.
void setSpellcheck(bool s)
Enable or disable spellchecking on this text field.
QString getLabel()
Return the label.
void setAllowEmpty(bool e)
Validate this field against empty-ness.
VFS_form_field(QString type)
void setOption(QString o, QJsonValue v)
Set a widget option.
void setLabel(QString l, bool replace=true)
Set the label.
void setTip(QString t)
Set the tooltip.
void setHidden(bool e)
Keep the field, but hide it when rendering.
void setHideLabel(bool l)
Hide the label for this field.
void clearOption(QString o)
Clear/remove a widget option.
void setValue(QJsonValue val)
Set the value.
int getIndex()
Get the field index.
QJsonObject options
Options for any widget type... this is an arbitrary list.
void setIndex(int i)
Set the field index for this widget.