Don't call me Nymphadora
A library built on top of Qt Widgets that allows you to dynamically build UIs for displaying and editing settings based on a JSON schema.
- Define your settings schema (see schema example below)
- QTonks will build a UI based on it
- Changing each setting from a UI will emit a signal with JSON containing all the settings
- You can load a JSON with current settings to update a UI as well
Switch: a checkbox with a label that can be on or offEnumeration: a group of options you can choose fromInteger: a field with an integer number and up/down buttonsFloat: a field with a floating point number, up/down buttons, and a configurable stepColor: a control to pick a color using a dedicated color pickerGroup: a container for any number of nested QTonks widgets
Copy the following schema to the example application to get an idea how it works
{
"schema":
[
{
"name": "enableSomeStuff",
"type": "switch",
"label": "Enable some stuff"
},
{
"name": "someOptionWithChoices",
"type": "enumeration",
"label": "Enumeration",
"options": [
"one", "two", "three"
],
"labels": [
"Fancy label one",
"Very fancy label two",
"Not so fancy label three"
],
"defaultOption": "one"
},
{
"name": "someIntegerValue",
"label": "Number of something",
"type": "integer",
"min": 0,
"max": 100,
"default": 42
},
{
"name": "someFloatValue",
"label": "Some float value",
"type": "float",
"min": 0.0,
"max": 1.0,
"step": 0.01,
"default": 0.5
},
{
"name": "someGroup",
"type": "group",
"label": "Group of settings",
"content":
[
{
"name": "enableSomeGroupedStuff",
"type": "switch",
"label": "Enable some grouped stuff"
},
{
"name": "enableSomeOtherGroupedStuff",
"type": "switch",
"label": "Enable some other grouped stuff"
},
{
"name": "nestedGroup",
"type": "group",
"label": "Nested group of settings",
"content":
[
{
"name": "nestedSwitch",
"type": "switch",
"label": "Wow!"
},
{
"name": "anotherDoubleValue",
"type": "float",
"label": "Some other float value",
"min": 5,
"max": 10,
"step": 0.1,
"default": 7
}
]
}
]
},
{
"name": "colorPicker",
"type": "color",
"label": "Pick your favorite color",
"default": "#aa00ff"
}
]
}