Extra Settings JSON Layout

Extra Settings JSON Layout - Is a special file which is used to declare set of extra propertes for your element in the config pack.

Specification
The full specification of Extra Settings Layout. JSON file you are creating must be saved in UTF8 encoding.



Root

 * style - string, Defines the type of layout
 * tree - Show extra settings as a table of settings
 * groupbox - Show extra settings as GUI elements
 * button - Show extra settings as GUI elements with using of expandable / collapsable blocks
 * title - string, Defines the title of extra settings layout box
 * layout - array, Contains list of control elements are will be presented on the layout

Control element

 * control - [REQUIRED], string, type of control.
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover

Control: spinBox
Gives integer or decimal setting.
 * control - must be set to "spinBox" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover


 * type - [REQUIRED], string, Type of value: integer or decimal:
 * int - Integer type
 * double - Decimal type


 * value-default - [REQUIRED], integer/decial, Initial value of this control
 * value-min - [Optional], integer/decial, Minimal allowed value
 * value-max - [Optional], integer/decial, Maximal allowed value
 * single-step - [Optional], integer/decial, Size of one value change step, done by mouse wheel or arrow buttons on the control
 * decimals - [Optional], integer, Precission of the decimal number value

Control: checkBox
Gives boolean settings.


 * control - must be set to "checkBox" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover
 * value-default - [REQUIRED], boolean (`true` or `false`), Initial value of this control

Control: color
Gives color settings.


 * control - must be set to "color" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover
 * value-default - [REQUIRED], a hex color (`#RRGGBB`, or `#RRGGBBAA`, or constant color name, etc. that approvable by QColor), Initial value of this control

Quote from Qt documentation related to color string format

Sets the RGB value of this QColor to name, which may be in one of these formats:
 * #RGB (each of R, G, and B is a single hex digit)
 * #RRGGBB
 * #AARRGGBB (Since 5.2)
 * #RRRGGGBBB
 * #RRRRGGGGBBBB
 * A name from the list of colors defined in the list of SVG color keyword names provided by the World Wide Web Consortium; for example, "steelblue" or "gainsboro". These color names work on all platforms. Note that these color names are not the same as defined by the Qt::GlobalColor enums, e.g. "green" and Qt::green does not refer to the same color.
 * transparent - representing the absence of a color.

The color is invalid if name cannot be parsed.

Control: comboBox
Gives an indexed labeled list of settings.


 * control - must be set to "comboBox" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover
 * elements - [REQUIRED], array of strings, Elements for choice.
 * value-default - [REQUIRED], integer, Initial value of this control, index of element in the given list

Control: flagBox
Gives a group of boolean settings are stored as integer and indexed bitwisely per bit at left.


 * control - must be set to "flagBox" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover
 * elements - [REQUIRED], array of strings, Elements for choice.
 * value-default - [REQUIRED], integer, Initial value of this control, a bitwise mask of all flags are set or unset.

Control: lineEdit
Gives a text string setting.


 * control - must be set to "lineEdit" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover
 * value-default - [REQUIRED], string, Initial value of this control.
 * max-length - [Optional], integer, String length limitation. If not defined, string length is not limited.
 * validator - [Optional], string, Regular Expression which stricts specific string format that must be typed into this field.

Control: sizeBox
Gives a group of two integer or decimal settings are labeled as Width and Height.


 * control - must be set to "sizeBox" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover


 * type - [REQUIRED], string, Type of value: integer or decimal:
 * int - Integer type
 * double - Decimal type


 * value-default - [REQUIRED], object, Initial value of this control
 * w - [REQUIRED], integer/decimal, Width value
 * h - [REQUIRED], integer/decimal, Height value


 * value-min - [Optional], object, Minimal allowed value
 * w - [REQUIRED], integer/decimal, Width value
 * h - [REQUIRED], integer/decimal, Height value


 * value-max - [Optional], object, Maximal allowed value
 * w - [REQUIRED], integer/decimal, Width value
 * h - [REQUIRED], integer/decimal, Height value

Control: pointBox
Gives a group of two integer or decimal settings are labeled as X and Y.


 * control - must be set to "pointBox" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover


 * type - [REQUIRED], string, Type of value: integer or decimal:
 * int - Integer type
 * double - Decimal type


 * value-default - [REQUIRED], object, Initial value of this control
 * x - [REQUIRED], integer/decimal, X position value
 * y - [REQUIRED], integer/decimal, Y position value


 * value-min - [Optional], object, Minimal allowed value
 * x - [REQUIRED], integer/decimal, X position value
 * y - [REQUIRED], integer/decimal, Y position value


 * value-max - [Optional], object, Maximal allowed value
 * x - [REQUIRED], integer/decimal, X position value
 * y - [REQUIRED], integer/decimal, Y position value

Control: rectBox
Gives a group of four integer or decimal settings are labeled as X, Y, Width, and Height.


 * control - must be set to "rectBox" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover


 * type - [REQUIRED], string, Type of value: integer or decimal:
 * int - Integer type
 * double - Decimal type


 * value-default - [REQUIRED], object, Initial value of this control
 * x - [REQUIRED], integer/decimal, X position value
 * y - [REQUIRED], integer/decimal, Y position value
 * w - [REQUIRED], integer/decimal, Width value
 * h - [REQUIRED], integer/decimal, Height value


 * value-min - [Optional], object, Minimal allowed value
 * x - [REQUIRED], integer/decimal, X position value
 * y - [REQUIRED], integer/decimal, Y position value
 * w - [REQUIRED], integer/decimal, Width value
 * h - [REQUIRED], integer/decimal, Height value


 * value-max - [Optional], object, Maximal allowed value
 * x - [REQUIRED], integer/decimal, X position value
 * y - [REQUIRED], integer/decimal, Y position value
 * w - [REQUIRED], integer/decimal, Width value
 * h - [REQUIRED], integer/decimal, Height value

Control: Group of controls (sub-tree)
Gives you a sub-tree of elements.


 * control - must be set to "group" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * children - [REQUIRED], array, Child controls are included into this group.

Example layout
An example layout

Example of settings dump
An example settings dump generated from given sample. Note that fields are not appearing in this dump on first change only.