dataset

The guidata.dataset package provides the core features for data set display and editing with automatically generated graphical user interfaces.

dataset.dataitems

The guidata.dataset.dataitems module contains implementation for concrete DataItems.

class guidata.dataset.dataitems.NumericTypeItem(label, default=None, min=None, max=None, nonzero=None, unit='', help='', check=True)[source]

Numeric data item

get_auto_help(instance)[source]

Override DataItem method

format_string(instance, value, fmt, func)[source]

Override DataItem method

check_value(value)[source]

Override DataItem method

from_string(value)[source]

Override DataItem method

class guidata.dataset.dataitems.FloatItem(label, default=None, min=None, max=None, nonzero=None, unit='', step=0.1, slider=False, help='', check=True)[source]
Construct a float data item
  • label [string]: name

  • default [float]: default value (optional)

  • min [float]: minimum value (optional)

  • max [float]: maximum value (optional)

  • slider [bool]: if True, shows a slider widget right after the line edit widget (default is False)

  • step [float]: step between tick values with a slider widget (optional)

  • nonzero [bool]: if True, zero is not a valid value (optional)

  • unit [string]: physical unit (optional)

  • help [string]: text shown in tooltip (optional)

  • check [bool]: if False, value is not checked (optional, default=True)

type

alias of float

get_value_from_reader(reader)[source]

Reads value from the reader object, inside the try…except statement defined in the base item deserialize method

class guidata.dataset.dataitems.IntItem(label, default=None, min=None, max=None, nonzero=None, unit='', even=None, slider=False, help='', check=True)[source]
Construct an integer data item
  • label [string]: name

  • default [int]: default value (optional)

  • min [int]: minimum value (optional)

  • max [int]: maximum value (optional)

  • nonzero [bool]: if True, zero is not a valid value (optional)

  • unit [string]: physical unit (optional)

  • even [bool]: if True, even values are valid, if False, odd values are valid if None (default), ignored (optional)

  • slider [bool]: if True, shows a slider widget right after the line edit widget (default is False)

  • help [string]: text shown in tooltip (optional)

  • check [bool]: if False, value is not checked (optional, default=True)

type

alias of int

get_auto_help(instance)[source]

Override DataItem method

check_value(value)[source]

Override DataItem method

get_value_from_reader(reader)[source]

Reads value from the reader object, inside the try…except statement defined in the base item deserialize method

class guidata.dataset.dataitems.StringItem(label, default=None, notempty=None, wordwrap=False, help='')[source]
Construct a string data item
  • label [string]: name

  • default [string]: default value (optional)

  • help [string]: text shown in tooltip (optional)

  • notempty [bool]: if True, empty string is not a valid value (opt.)

  • wordwrap [bool]: toggle word wrapping (optional)

check_value(value)[source]

Override DataItem method

from_string(value)[source]

Override DataItem method

get_value_from_reader(reader)[source]

Reads value from the reader object, inside the try…except statement defined in the base item deserialize method

class guidata.dataset.dataitems.TextItem(label, default=None, notempty=None, wordwrap=True, help='')[source]
Construct a text data item (multiline string)
  • label [string]: name

  • default [string]: default value (optional)

  • help [string]: text shown in tooltip (optional)

  • notempty [bool]: if True, empty string is not a valid value (opt.)

  • wordwrap [bool]: toggle word wrapping (optional)

class guidata.dataset.dataitems.BoolItem(text='', label='', default=None, help='', check=True)[source]
Construct a boolean data item
  • text [string]: form’s field name (optional)

  • label [string]: name

  • default [string]: default value (optional)

  • help [string]: text shown in tooltip (optional)

  • check [bool]: if False, value is not checked (optional, default=True)

type

alias of bool

get_value_from_reader(reader)[source]

Reads value from the reader object, inside the try…except statement defined in the base item deserialize method

class guidata.dataset.dataitems.DateItem(label, default=None, help='', check=True)[source]
Construct a date data item.
  • text [string]: form’s field name (optional)

  • label [string]: name

  • default [datetime.date]: default value (optional)

  • help [string]: text shown in tooltip (optional)

type

alias of date

class guidata.dataset.dataitems.DateTimeItem(label, default=None, help='', check=True)[source]
class guidata.dataset.dataitems.ColorItem(label, default=None, notempty=None, wordwrap=False, help='')[source]
Construct a color data item
  • label [string]: name

  • default [string]: default value (optional)

  • help [string]: text shown in tooltip (optional)

  • check [bool]: if False, value is not checked (optional, default=True)

Color values are encoded as hexadecimal strings or Qt color names

check_value(value)[source]

Override DataItem method

get_value_from_reader(reader)[source]

Reads value from the reader object, inside the try…except statement defined in the base item deserialize method

class guidata.dataset.dataitems.FileSaveItem(label, formats='*', default=None, basedir=None, all_files_first=False, help='', check=True)[source]
Construct a path data item for a file to be saved
  • label [string]: name

  • formats [string (or string list)]: wildcard filter

  • default [string]: default value (optional)

  • basedir [string]: default base directory (optional)

  • help [string]: text shown in tooltip (optional)

  • check [bool]: if False, value is not checked (optional, default=True)

get_auto_help(instance)[source]

Override DataItem method

check_value(value)[source]

Override DataItem method

from_string(value)[source]

Override DataItem method

class guidata.dataset.dataitems.FileOpenItem(label, formats='*', default=None, basedir=None, all_files_first=False, help='', check=True)[source]
Construct a path data item for a file to be opened
  • label [string]: name

  • formats [string (or string list)]: wildcard filter

  • default [string]: default value (optional)

  • basedir [string]: default base directory (optional)

  • help [string]: text shown in tooltip (optional)

  • check [bool]: if False, value is not checked (optional, default=True)

check_value(value)[source]

Override DataItem method

class guidata.dataset.dataitems.FilesOpenItem(label, formats='*', default=None, basedir=None, all_files_first=False, help='', check=True)[source]
Construct a path data item for multiple files to be opened.
  • label [string]: name

  • formats [string (or string list)]: wildcard filter

  • default [string]: default value (optional)

  • basedir [string]: default base directory (optional)

  • help [string]: text shown in tooltip (optional)

  • check [bool]: if False, value is not checked (optional, default=True)

type

alias of list

check_value(value)[source]

Override DataItem method

from_string(value)[source]

Override DataItem method

serialize(instance, writer)[source]

Serialize this item

get_value_from_reader(reader)[source]

Reads value from the reader object, inside the try…except statement defined in the base item deserialize method

class guidata.dataset.dataitems.DirectoryItem(label, default=None, notempty=None, wordwrap=False, help='')[source]
Construct a path data item for a directory.
  • label [string]: name

  • default [string]: default value (optional)

  • help [string]: text shown in tooltip (optional)

  • check [bool]: if False, value is not checked (optional, default=True)

check_value(value)[source]

Override DataItem method

class guidata.dataset.dataitems.ChoiceItem(label, choices, default=<class 'guidata.dataset.dataitems.FirstChoice'>, help='', check=True, radio=False)[source]
Construct a data item for a list of choices.
  • label [string]: name

  • choices [list, tuple or function]: string list or (key, label) list function of two arguments (item, value) returning a list of tuples (key, label, image) where image is an icon path, a QIcon instance or a function of one argument (key) returning a QIcon instance

  • default [-]: default label or default key (optional)

  • help [string]: text shown in tooltip (optional)

  • check [bool]: if False, value is not checked (optional, default=True)

  • radio [bool]: if True, shows radio buttons instead of a combo box (default is False)

get_string_value(instance)[source]

Override DataItem method

class guidata.dataset.dataitems.MultipleChoiceItem(label, choices, default=(), help='', check=True)[source]
Construct a data item for a list of choices – multiple choices can be selected
  • label [string]: name

  • choices [list or tuple]: string list or (key, label) list

  • default [-]: default label or default key (optional)

  • help [string]: text shown in tooltip (optional)

  • check [bool]: if False, value is not checked (optional, default=True)

horizontal(row_nb=1)[source]

Method to arange choice list horizontally on n rows

Example: nb = MultipleChoiceItem(“Number”, [‘1’, ‘2’, ‘3’] ).horizontal(2)

vertical(col_nb=1)[source]

Method to arange choice list vertically on n columns

Example: nb = MultipleChoiceItem(“Number”, [‘1’, ‘2’, ‘3’] ).vertical(2)

serialize(instance, writer)[source]

Serialize this item

deserialize(instance, reader)[source]

Deserialize this item

class guidata.dataset.dataitems.ImageChoiceItem(label, choices, default=<class 'guidata.dataset.dataitems.FirstChoice'>, help='', check=True, radio=False)[source]
Construct a data item for a list of choices with images
  • label [string]: name

  • choices [list, tuple or function]: (label, image) list or (key, label, image) list function of two arguments (item, value) returning a list of tuples (key, label, image) where image is an icon path, a QIcon instance or a function of one argument (key) returning a QIcon instance

  • default [-]: default label or default key (optional)

  • help [string]: text shown in tooltip (optional)

  • check [bool]: if False, value is not checked (optional, default=True)

class guidata.dataset.dataitems.FloatArrayItem(label, default=None, help='', format='%.3f', transpose=False, minmax='all', check=True)[source]
Construct a float array data item
  • label [string]: name

  • default [numpy.ndarray]: default value (optional)

  • help [string]: text shown in tooltip (optional)

  • format [string]: formatting string (example: ‘%.3f’) (optional)

  • transpose [bool]: transpose matrix (display only)

  • large [bool]: view all float of the array

  • minmax [string]: “all” (default), “columns”, “rows”

  • check [bool]: if False, value is not checked (optional, default=True)

format_string(instance, value, fmt, func)[source]

Override DataItem method

serialize(instance, writer)[source]

Serialize this item

get_value_from_reader(reader)[source]

Reads value from the reader object, inside the try…except statement defined in the base item deserialize method

class guidata.dataset.dataitems.ButtonItem(label, callback, icon=None, default=None, help='', check=True)[source]
Construct a simple button that calls a method when hit
  • label [string]: text shown on the button

  • callback [function]: function with four parameters (dataset, item, value, parent)
    • dataset [DataSet]: instance of the parent dataset

    • item [DataItem]: instance of ButtonItem (i.e. self)

    • value [unspecified]: value of ButtonItem (default ButtonItem value or last value returned by the callback)

    • parent [QObject]: button’s parent widget

  • icon [QIcon or string]: icon show on the button (optional) (string: icon filename as in guidata/guiqwt image search paths)

  • default [unspecified]: default value passed to the callback (optional)

  • help [string]: text shown in button’s tooltip (optional)

  • check [bool]: if False, value is not checked (optional, default=True)

The value of this item is unspecified but is passed to the callback along with the whole dataset. The value is assigned the callback`s return value.

serialize(instance, writer)[source]

Serialize this item using the writer object

this is a default implementation that should work for everything but new datatypes

deserialize(instance, reader)[source]

Deserialize this item using the reader object

Default base implementation supposes the reader can detect expected datatype from the stream

class guidata.dataset.dataitems.DictItem(label, default=None, help='', check=True)[source]
Construct a dictionary data item
  • label [string]: name

  • default [dict]: default value (optional)

  • help [string]: text shown in tooltip (optional)

  • check [bool]: if False, value is not checked (optional, default=True)

class guidata.dataset.dataitems.FontFamilyItem(label, default=None, notempty=None, wordwrap=False, help='')[source]
Construct a font family name item
  • label [string]: name

  • default [string]: default value (optional)

  • help [string]: text shown in tooltip (optional)

dataset.datatypes

The guidata.dataset.datatypes module contains implementation for DataSets (DataSet, DataSetGroup, …) and related objects (ItemProperty, ValueProp, …).

class guidata.dataset.datatypes.FormatProp(fmt, ignore_error=True)[source]

A Property that returns a string to help custom read-only representation of items

class guidata.dataset.datatypes.GetAttrProp(attr)[source]

A property that matches the value of an instance’s attribute

set(instance, item, value)[source]

Sets the value of the property given an instance, item and value Depending on implementation the value will be stored either on the instance, item or self

class guidata.dataset.datatypes.ValueProp(value)[source]

A property that retrieves a value stored elsewhere

set(instance, item, value)[source]

Sets the value of the property given an instance, item and value Depending on implementation the value will be stored either on the instance, item or self

class guidata.dataset.datatypes.NotProp(prop)[source]

Not property

set(instance, item, value)[source]

Sets the value of the property given an instance, item and value Depending on implementation the value will be stored either on the instance, item or self

class guidata.dataset.datatypes.FuncProp(prop, func, invfunc=None)[source]

An ‘operator property’ prop: ItemProperty instance func: function invfunc: inverse function (optional)

set(instance, item, value)[source]

Sets the value of the property given an instance, item and value Depending on implementation the value will be stored either on the instance, item or self

class guidata.dataset.datatypes.DataItem(label, default=None, help='', check=True)[source]

DataSet data item

label : string default : any type, optional help : string Text displayed on data item’s tooltip

get_prop(realm, name, default=<class 'guidata.dataset.datatypes.NoDefault'>)[source]

Get one property of this item

set_prop(realm, **kwargs)[source]

Set one or several properties using the syntax set_prop(name1=value1, …, nameX=valueX)

it returns self so that we can assign to the result like this:

item = Item().set_prop(x=y)

set_pos(col=0, colspan=None, row=None)[source]

Set data item’s position on a GUI layout

get_help(instance)[source]

Return data item’s tooltip

get_auto_help(instance)[source]

Return the automatically generated part of data item’s tooltip

format_string(instance, value, fmt, func)[source]

Apply format to string representation of the item’s value

get_string_value(instance)[source]

Return a formatted unicode representation of the item’s value obeying ‘display’ or ‘repr’ properties

set_name(new_name)[source]

Set data item’s name

set_help(new_help)[source]

Set data item’s help text

set_from_string(instance, string_value)[source]

Set data item’s value from specified string

set_default(instance)[source]

Set data item’s value to default

accept(visitor)[source]

This is the visitor pattern’s accept function. It calls the corresponding visit_MYCLASS method of the visitor object.

Python’s allow a generic base class implementation of this method so there’s no need to write an accept function for each derived class unless you need to override the default behavior

get_value(instance)[source]

Return data item’s value

check_item(instance)[source]

Check data item’s current value (calling method check_value)

check_value(instance, value)[source]

Check if value is valid for this data item

from_string(instance, string_value)[source]

Transform string into valid data item’s value

bind(instance)[source]

Return a DataItemVariable instance bound to the data item

serialize(instance, writer)[source]

Serialize this item using the writer object

this is a default implementation that should work for everything but new datatypes

get_value_from_reader(reader)[source]

Reads value from the reader object, inside the try…except statement defined in the base item deserialize method

This method is reimplemented in some child classes

deserialize(instance, reader)[source]

Deserialize this item using the reader object

Default base implementation supposes the reader can detect expected datatype from the stream

class guidata.dataset.datatypes.Obj(**kwargs)[source]

An object that helps build default instances for ObjectItems

class guidata.dataset.datatypes.ObjectItem(label, default=None, help='', check=True)[source]

Simple helper class implementing default for composite objects

set_default(instance)[source]

Make a copy of the default value

deserialize(instance, reader)[source]

Deserialize this item using the reader object

We build a new default object and deserialize it

class guidata.dataset.datatypes.DataItemProxy(item)[source]

Proxy for DataItem objects

This class is needed to construct GroupItem class (see module guidata.qtwidgets)

get_help(instance)[source]

DataItem method proxy

get_auto_help(instance)[source]

DataItem method proxy

get_string_value(instance)[source]

DataItem method proxy

set_from_string(instance, string_value)[source]

DataItem method proxy

set_default(instance)[source]

DataItem method proxy

accept(visitor)[source]

DataItem method proxy

get_value(instance)[source]

DataItem method proxy

check_item(instance)[source]

DataItem method proxy

check_value(instance, value)[source]

DataItem method proxy

from_string(instance, string_value)[source]

DataItem method proxy

get_prop(realm, name, default=<class 'guidata.dataset.datatypes.NoDefault'>)[source]

DataItem method proxy

get_prop_value(realm, instance, name, default=<class 'guidata.dataset.datatypes.NoDefault'>)[source]

DataItem method proxy

set_prop(realm, **kwargs)[source]

DataItem method proxy

bind(instance)[source]

DataItem method proxy

class guidata.dataset.datatypes.DataItemVariable(item, instance)[source]

An instance of a DataItemVariable represent a binding between an item and a dataset.

could be called a bound property.

since DataItem instances are class attributes they need to have a DataSet instance to store their value. This class binds the two together.

get_prop_value(realm, name, default=<class 'guidata.dataset.datatypes.NoDefault'>)[source]

DataItem method proxy

get_prop(realm, name, default=<class 'guidata.dataset.datatypes.NoDefault'>)[source]

DataItem method proxy

get_help()[source]

Re-implement DataItem method

get_auto_help()[source]

Re-implement DataItem method

get_string_value()[source]

Return a unicode representation of the item’s value obeying ‘display’ or ‘repr’ properties

set_default()[source]

Re-implement DataItem method

get()[source]

Re-implement DataItem method

set(value)[source]

Re-implement DataItem method

set_from_string(string_value)[source]

Re-implement DataItem method

check_item()[source]

Re-implement DataItem method

check_value(value)[source]

Re-implement DataItem method

from_string(string_value)[source]

Re-implement DataItem method

label()[source]

Re-implement DataItem method

class guidata.dataset.datatypes.DataSetMeta(name, bases, dct)[source]

DataSet metaclass

Create class attribute _items: list of the DataSet class attributes, created in the same order as these attributes were written

class guidata.dataset.datatypes.DataSet(title=None, comment=None, icon='')[source]
Construct a DataSet object is a set of DataItem objects
  • title [string]

  • comment [string]: text shown on the top of the first data item

  • icon [QIcon or string]: icon show on the button (optional) (string: icon filename as in guidata/guiqwt image search paths)

get_title()[source]

Return data set title

get_comment()[source]

Return data set comment

get_icon()[source]

Return data set icon

set_defaults()[source]

Set default values

check()[source]

Check the dataset item values

text_edit()[source]

Edit data set with text input only

edit(parent=None, apply=None, size=None)[source]
Open a dialog box to edit data set
  • parent: parent widget (default is None, meaning no parent)

  • apply: apply callback (default is None)

  • size: dialog size (QSize object or integer tuple (width, height))

view(parent=None, size=None)[source]
Open a dialog box to view data set
  • parent: parent widget (default is None, meaning no parent)

  • size: dialog size (QSize object or integer tuple (width, height))

to_string(debug=False, indent=None, align=False)[source]

Return readable string representation of the data set If debug is True, add more details on data items

accept(vis)[source]

helper function that passes the visitor to the accept methods of all the items in this dataset

class guidata.dataset.datatypes.ActivableDataSet(title=None, comment=None, icon='')[source]

An ActivableDataSet instance must have an “enable” class attribute which will set the active state of the dataset instance (see example in: tests/activable_dataset.py)

classmethod active_setup()[source]

This class method must be called after the child class definition in order to setup the dataset active state

set_readonly()[source]

The dataset is now in read-only mode, i.e. all data items are disabled

set_writeable()[source]

The dataset is now in read/write mode, i.e. all data items are enabled

class guidata.dataset.datatypes.DataSetGroup(datasets, title=None, icon='')[source]
Construct a DataSetGroup object, used to group several datasets together
  • datasets [list of DataSet objects]

  • title [string]

  • icon [QIcon or string]: icon show on the button (optional) (string: icon filename as in guidata/guiqwt image search paths)

This class tries to mimics the DataSet interface.

The GUI should represent it as a notebook with one page for each contained dataset.

get_title()[source]

Return data set group title

get_comment()[source]

Return data set group comment –> not implemented (will return None)

check()[source]

Check data set group items

text_edit()[source]

Edit data set with text input only

edit(parent=None, apply=None)[source]

Open a dialog box to edit data set

accept(vis)[source]

helper function that passes the visitor to the accept methods of all the items in this dataset

class guidata.dataset.datatypes.GroupItem(item)[source]

GroupItem proxy

class guidata.dataset.datatypes.BeginGroup(label, default=None, help='', check=True)[source]

Data item which does not represent anything but a begin flag to define a data set group

serialize(instance, writer)[source]

Serialize this item using the writer object

this is a default implementation that should work for everything but new datatypes

deserialize(instance, reader)[source]

Deserialize this item using the reader object

Default base implementation supposes the reader can detect expected datatype from the stream

class guidata.dataset.datatypes.EndGroup(label, default=None, help='', check=True)[source]

Data item which does not represent anything but an end flag to define a data set group

serialize(instance, writer)[source]

Serialize this item using the writer object

this is a default implementation that should work for everything but new datatypes

deserialize(instance, reader)[source]

Deserialize this item using the reader object

Default base implementation supposes the reader can detect expected datatype from the stream

class guidata.dataset.datatypes.TabGroupItem(item)[source]
class guidata.dataset.datatypes.BeginTabGroup(label, default=None, help='', check=True)[source]
class guidata.dataset.datatypes.EndTabGroup(label, default=None, help='', check=True)[source]

dataset.qtitemwidgets

Widget factories used to edit data items (factory registration is done in guidata.dataset.qtwidgets) (data item types are defined in guidata.dataset.datatypes)

There is one widget type for each data item type. Example: ChoiceWidget <–> ChoiceItem, ImageChoiceItem

class guidata.dataset.qtitemwidgets.AbstractDataSetWidget(item, parent_layout)[source]

Base class for ‘widgets’ handled by DataSetEditLayout and it’s derived classes.

This is a generic representation of an input (or display) widget that has a label and one or more entry field.

DataSetEditLayout uses a registry of Item to Widget mapping in order to automatically create a GUI for a DataSet structure

place_label(layout, row, column)[source]

Place item label on layout at specified position (row, column)

place_on_grid(layout, row, label_column, widget_column, row_span=1, column_span=1)[source]

Place widget on layout at specified position

is_active()[source]

Return True if associated item is active

check()[source]

Item validator

set()[source]

Update data item value from widget contents

get()[source]

Update widget contents from data item value

value()[source]

Returns the widget’s current value

set_state()[source]

Update the visual status of the widget

notify_value_change()[source]

Notify parent layout that widget value has changed

class guidata.dataset.qtitemwidgets.GroupWidget(item, parent_layout)[source]

GroupItem widget

get()[source]

Override AbstractDataSetWidget method

set()[source]

Override AbstractDataSetWidget method

check()[source]

Override AbstractDataSetWidget method

place_on_grid(layout, row, label_column, widget_column, row_span=1, column_span=1)[source]

Override AbstractDataSetWidget method

class guidata.dataset.qtitemwidgets.TabGroupWidget(item, parent_layout)[source]
get()[source]

Override AbstractDataSetWidget method

set()[source]

Override AbstractDataSetWidget method

check()[source]

Override AbstractDataSetWidget method

place_on_grid(layout, row, label_column, widget_column, row_span=1, column_span=1)[source]

Override AbstractDataSetWidget method

class guidata.dataset.qtitemwidgets.LineEditWidget(item, parent_layout)[source]

QLineEdit-based widget

get()[source]

Override AbstractDataSetWidget method

line_edit_changed(qvalue)[source]

QLineEdit validator

update(value)[source]

Override AbstractDataSetWidget method

value()[source]

Returns the widget’s current value

check()[source]

Override AbstractDataSetWidget method

class guidata.dataset.qtitemwidgets.TextEditWidget(item, parent_layout)[source]

QTextEdit-based widget

get()[source]

Override AbstractDataSetWidget method

text_changed()[source]

QLineEdit validator

update(value)[source]

Override AbstractDataSetWidget method

value()[source]

Returns the widget’s current value

check()[source]

Override AbstractDataSetWidget method

class guidata.dataset.qtitemwidgets.CheckBoxWidget(item, parent_layout)[source]

BoolItem widget

get()[source]

Override AbstractDataSetWidget method

set()[source]

Override AbstractDataSetWidget method

value()[source]

Returns the widget’s current value

place_on_grid(layout, row, label_column, widget_column, row_span=1, column_span=1)[source]

Override AbstractDataSetWidget method

class guidata.dataset.qtitemwidgets.DateWidget(item, parent_layout)[source]

DateItem widget

get()[source]

Override AbstractDataSetWidget method

set()[source]

Override AbstractDataSetWidget method

value()[source]

Returns the widget’s current value

class guidata.dataset.qtitemwidgets.DateTimeWidget(item, parent_layout)[source]

DateTimeItem widget

get()[source]

Override AbstractDataSetWidget method

set()[source]

Override AbstractDataSetWidget method

value()[source]

Returns the widget’s current value

class guidata.dataset.qtitemwidgets.GroupLayout[source]
addWidget(self, a0: QWidget, stretch: int = 0, alignment: Union[Qt.Alignment, Qt.AlignmentFlag] = Qt.Alignment())[source]
setEnabled(self, a0: bool)[source]
class guidata.dataset.qtitemwidgets.ColorWidget(item, parent_layout)[source]

ColorItem widget

update(value)[source]

Reimplement LineEditWidget method

select_color()[source]

Open a color selection dialog box

class guidata.dataset.qtitemwidgets.SliderWidget(item, parent_layout)[source]

IntItem with Slider

DATA_TYPE

alias of int

update(value)[source]

Reimplement LineEditWidget method

value_changed(ivalue)[source]

Update the lineedit

class guidata.dataset.qtitemwidgets.FloatSliderWidget(item, parent_layout)[source]

FloatItem with Slider

DATA_TYPE

alias of float

class guidata.dataset.qtitemwidgets.FileWidget(item, parent_layout, filedialog)[source]

File path item widget

select_file()[source]

Open a file selection dialog box

class guidata.dataset.qtitemwidgets.DirectoryWidget(item, parent_layout)[source]

Directory path item widget

select_directory()[source]

Open a directory selection dialog box

class guidata.dataset.qtitemwidgets.ChoiceWidget(item, parent_layout)[source]

Choice item widget

get()[source]

Override AbstractDataSetWidget method

set()[source]

Override AbstractDataSetWidget method

value()[source]

Returns the widget’s current value

class guidata.dataset.qtitemwidgets.MultipleChoiceWidget(item, parent_layout)[source]

Multiple choice item widget

get()[source]

Override AbstractDataSetWidget method

set()[source]

Override AbstractDataSetWidget method

value()[source]

Returns the widget’s current value

place_on_grid(layout, row, label_column, widget_column, row_span=1, column_span=1)[source]

Override AbstractDataSetWidget method

class guidata.dataset.qtitemwidgets.FloatArrayWidget(item, parent_layout)[source]

FloatArrayItem widget

edit_array()[source]

Open an array editor dialog

get()[source]

Override AbstractDataSetWidget method

update(arr)[source]

Override AbstractDataSetWidget method

set()[source]

Override AbstractDataSetWidget method

value()[source]

Returns the widget’s current value

place_on_grid(layout, row, label_column, widget_column, row_span=1, column_span=1)[source]

Override AbstractDataSetWidget method

class guidata.dataset.qtitemwidgets.ButtonWidget(item, parent_layout)[source]

BoolItem widget

get()[source]

Override AbstractDataSetWidget method

set()[source]

Override AbstractDataSetWidget method

value()[source]

Returns the widget’s current value

place_on_grid(layout, row, label_column, widget_column, row_span=1, column_span=1)[source]

Override AbstractDataSetWidget method

class guidata.dataset.qtitemwidgets.DataSetWidget(item, parent_layout)[source]

DataSet widget

get()[source]

Override AbstractDataSetWidget method

set()[source]

Override AbstractDataSetWidget method

get_dataset()[source]

update’s internal parameter representation from the item’s stored value

default behavior uses update_dataset and assumes internal dataset class is the same as item’s value class

set_dataset()[source]

update the item’s value from the internal data representation

default behavior uses restore_dataset and assumes internal dataset class is the same as item’s value class

place_on_grid(layout, row, label_column, widget_column, row_span=1, column_span=1)[source]

Override AbstractDataSetWidget method

dataset.qtwidgets

Dialog boxes used to edit data sets:

DataSetEditDialog DataSetGroupEditDialog DataSetShowDialog

…and layouts:

GroupItem DataSetEditLayout DataSetShowLayout

class guidata.dataset.qtwidgets.DataSetEditDialog(instance, icon='', parent=None, apply=None, wordwrap=True, size=None)[source]

Dialog box for DataSet editing

setup_instance(instance)[source]

Construct main layout

layout_factory(instance, grid)[source]

A factory method that produces instances of DataSetEditLayout

or derived classes (see DataSetShowDialog)

child_title(item)[source]

Return data item title combined with QApplication title

accept()[source]

Validate inputs

class guidata.dataset.qtwidgets.DataSetGroupEditDialog(instance, icon='', parent=None, apply=None, wordwrap=True, size=None)[source]

Tabbed dialog box for DataSet editing

setup_instance(instance)[source]

Override DataSetEditDialog method

class guidata.dataset.qtwidgets.DataSetEditLayout(parent, instance, layout, items=None, first_line=0, change_callback=None)[source]

Layout in which data item widgets are placed

classmethod register(item_type, factory)[source]

Register a factory for a new item_type

transform_items(items)[source]

Handle group of items: transform items into a GroupItem instance if they are located between BeginGroup and EndGroup

check_all_values()[source]

Check input of all widgets

accept_changes()[source]

Accept changes made to widget inputs

setup_layout(items)[source]

Place items on layout

add_row(widget)[source]

Add widget to row

refresh_widgets()[source]

Refresh the status of all widgets

update_dataitems()[source]

Refresh the content of all data items

update_widgets(except_this_one=None)[source]

Refresh the content of all widgets

widget_value_changed()[source]

Method called when any widget’s value has changed

class guidata.dataset.qtwidgets.DataSetShowWidget(item, parent_layout)[source]

Read-only base widget

get()[source]

Override AbstractDataSetWidget method

set()[source]

Read only…

class guidata.dataset.qtwidgets.ShowColorWidget(item, parent_layout)[source]

Read-only color item widget

get()[source]

Override AbstractDataSetWidget method

class guidata.dataset.qtwidgets.ShowBooleanWidget(item, parent_layout)[source]

Read-only bool item widget

place_on_grid(layout, row, label_column, widget_column, row_span=1, column_span=1)[source]

Override AbstractDataSetWidget method

get()[source]

Override AbstractDataSetWidget method

class guidata.dataset.qtwidgets.DataSetShowLayout(parent, instance, layout, items=None, first_line=0, change_callback=None)[source]

Read-only layout

class guidata.dataset.qtwidgets.DataSetShowDialog(instance, icon='', parent=None, apply=None, wordwrap=True, size=None)[source]

Read-only dialog box

layout_factory(instance, grid)[source]

Override DataSetEditDialog method

class guidata.dataset.qtwidgets.DataSetShowGroupBox(label, klass, wordwrap=False, **kwargs)[source]

Group box widget showing a read-only DataSet

get_edit_layout()[source]

Return edit layout

get()[source]

Update group box contents from data item values

class guidata.dataset.qtwidgets.DataSetEditGroupBox(label, klass, button_text=None, button_icon=None, show_button=True, wordwrap=False, **kwargs)[source]

Group box widget including a DataSet

label: group box label (string) klass: guidata.DataSet class button_text: action button text (default: “Apply”) button_icon: QIcon object or string (default “apply.png”)

SIG_APPLY_BUTTON_CLICKED

Signal emitted when Apply button is clicked

get_edit_layout()[source]

Return edit layout

change_callback()[source]

Method called when any widget’s value has changed

set()[source]

Update data item values from layout contents

set_apply_button_state(state)[source]

Set apply button enable/disable state

child_title(item)[source]

Return data item title combined with QApplication title