Examples

Basic example

Source code :

import guidata
_app = guidata.qapplication() # not required if a QApplication has already been created

import guidata.dataset.datatypes as dt
import guidata.dataset.dataitems as di

class Processing(dt.DataSet):
    """Example"""
    a = di.FloatItem("Parameter #1", default=2.3)
    b = di.IntItem("Parameter #2", min=0, max=10, default=5)
    type = di.ChoiceItem("Processing algorithm",
                         ("type 1", "type 2", "type 3"))

param = Processing()
param.edit()

Output :

_images/basic_example.png

Assigning values to data items or using these values is very easy :

param.a = 5.34
param.type = "type 3"
print "a*b =", param.a*param.b

Other examples

A lot of examples are available in the guidata test module

from guidata import tests
tests.run()

The two lines above execute the guidata test launcher :

_images/__init__.png

All guidata items demo

_images/all_items.png

Embedding guidata objects in GUI layouts

_images/editgroupbox.png

Data item groups and group selection

_images/bool_selector.png

Activable data sets

_images/activable_dataset.png

Data set groups

_images/datasetgroup.png