11.3.2.1. New Tree items

Documentation on the added or modified ParameterItem types compared to pyqtgraph.parametertree.parameterTypes module.

WidgetParameterItem and SimpleParameter have been subclassed to define more options:

  • int and float: represented by a custom Spinbox, see SpinBoxCustom()
  • bool, led, bool_push are represented respectively by a QCheckBox(), a QLED(), QPushButton()
  • str displays a QLineEdit widget
  • date_time displays a QDateTime widget
  • date displays a QDate widget
  • time displays a QTimeCustom() widget
  • pixmap displays a QPixmap in a QLabel
  • pixmap_check displays a custom Pixmap_check() widget

Other widgets for ParameterTree have been introduced:

  • group: subclassed group parameter, see GroupParameterCustom() and GroupParameterItemCustom()
  • slide: displays a custom Spinbox and a QSlider to set floats and ints, see SliderSpinBox()
  • list: subclassed pyqtgraph list that displays a list and a pushbutton to let the user add entries in the list, see ListParameter_custom() and ListParameterItem_custom() and Combo_pb()
  • table: subclassed pyqtgraph table, see TableParameterItem(), TableParameter() and Table_custom()
  • table_view : displaying a QTableView with custom model to be user defined, see Qt5 documentation, see TableViewParameterItem(), TableViewCustom() and TableViewParameter()
  • ìtemselect: displays a QListWidget with selectable elements, see ItemSelectParameterItem(), ItemSelect_pb(), ItemSelect() and ItemSelectParameter()
  • browsepath: displays an edit line and a push button to select files or folders, see file_browserParameterItem(), file_browser() and file_browserParameter()
  • text`: subclassed plain text area text from pyqtgraph with limited height, see TextParameterItemCustom() and TextParameter()
  • text_pb: displays a plain text area and a visible button to add data into it, see Plain_text_pbParameterItem(), Plain_text_pb() and Plain_text_pbParameter()

Created on Mon Dec 4 10:59:53 2017

@author: Weber

class pymodaq.daq_utils.parameter.pymodaq_ptypes.GroupParameterItemCustom(param, depth)[source]
Group parameters are used mainly as a generic parent item that holds (and groups!) a set of child parameters. It also provides a simple mechanism for displaying a button or combo that can be used to add new parameters to the group.

This customization is made in order to respond to the visible options.
Overwrite the optsChanged method from GroupParameterItem class.
optsChanged(param, changed)[source]

Called when any options are changed that are not name, value, default, or limits

class pymodaq.daq_utils.parameter.pymodaq_ptypes.GroupParameterCustom(**opts)[source]

Group parameters are used mainly as a generic parent item that holds (and groups!) a set of child parameters.

It also provides a simple mechanism for displaying a button or combo that can be used to add new parameters to the group.

To enable this, the group must be initialized with the ‘addText’ option (the text will be displayed on a button which, when clicked, will cause addNew() to be called).

If the ‘addList’ option is specified as well, then a dropdown-list of addable items will be displayed instead of a button.

Attributes Type
itemClass instance of GroupParameterItemCustom
itemClass

alias of GroupParameterItemCustom

class pymodaq.daq_utils.parameter.pymodaq_ptypes.SpinBoxCustom(parent=None, value=0.0, **kwargs)[source]
setOpts(**opts)[source]

Overriden class to add the field visible in the options.

Parameters Type Description
opts string the vararg options
class pymodaq.daq_utils.parameter.pymodaq_ptypes.Pixmap_check[source]

value of this parameter is a dict with checked, data for the pixmap and optionally path in h5 node

initUI()[source]

Init the User Interface.

class pymodaq.daq_utils.parameter.pymodaq_ptypes.QTimeCustom(*args, **kwargs)[source]
setTime(self, Union[QTime, datetime.time])[source]
class pymodaq.daq_utils.parameter.pymodaq_ptypes.SliderSpinBox(*args, subtype='lin', **kwargs)[source]
initUI(*args, **kwargs)[source]

Init the User Interface.

update_slide(val)[source]

val is the spinbox value between its min and max

update_spinbox(val)[source]

val is a percentage [0-100] used in order to set the spinbox value between its min and max

class pymodaq.daq_utils.parameter.pymodaq_ptypes.ListParameter_custom(**opts)[source]
Attributes Type
itemClass instance of ListParameterItem_custom
sigActivated instance of pyqt Signal
itemClass

alias of ListParameterItem_custom

activate()[source]

Emit the Activated signal.

class pymodaq.daq_utils.parameter.pymodaq_ptypes.ListParameterItem_custom(param, depth)[source]

WidgetParameterItem subclass providing comboBox that lets the user select from a list of options.

buttonClicked()[source]

Append the self limits attributes an added parameter with string value.
Update parameter and call the limitschanged method to map the added parameter.

See also

limitsChanged()

limitsChanged(param, limits)[source]

Set up forward / reverse mappings for {name:value} limits dictionnary.

Parameters Type Description
param instance of pyqtgraph parameter Not used
limits dictionnary the limits dictionnary to be mapped
makeWidget()[source]

Make a widget from self parameter options, connected to the buttonClicked function.

Returns:w – the initialized widget
Return type:widget
optsChanged(param, opts)[source]

Called when any options are changed that are not name, value, default, or limits.

Parameters Type Description
param instance of pyqtgraph parameter The parameter to be checked
opts string list The option dictionnary to be checked

See also

optsChanged()

class pymodaq.daq_utils.parameter.pymodaq_ptypes.Combo_pb(items=[])[source]
initUI()[source]

Init the User Interface.

class pymodaq.daq_utils.parameter.pymodaq_ptypes.TableParameterItem(param, depth)[source]
makeWidget()[source]

Make and initialize an instance of Table_custom.

Returns:table – The initialized table.
Return type:instance of Table_custom.

See also

Table_custom()

treeWidgetChanged()[source]

Check for changement in the Widget tree.

class pymodaq.daq_utils.parameter.pymodaq_ptypes.TableParameter(**opts)[source]
Attributes Type
itemClass instance of TableParameterItem
Parameter instance of pyqtgraph parameter
itemClass

Editable string; displayed as large text box in the tree.

alias of TableParameterItem

setValue(value)[source]

Set the value of this Parameter; return the actual value that was set. (this may be different from the value that was requested)

class pymodaq.daq_utils.parameter.pymodaq_ptypes.Table_custom[source]
Attributes* Type
valuechanged instance of pyqt Signal
QtWidgets instance of QTableWidget
get_table_value()[source]

Get the contents of the self coursed table.

Returns:data – The getted values dictionnary.
Return type:ordered dictionnary
set_table_value(data_dict)[source]

Set the data values dictionnary to the custom table.

Parameters Type Description
data_dict ordered dictionnary the contents to be stored in the custom table
class pymodaq.daq_utils.parameter.pymodaq_ptypes.TableViewParameterItem(param, depth)[source]
makeWidget()[source]

Make and initialize an instance of Table_custom.

Returns:table – The initialized table.
Return type:instance of Table_custom.

See also

Table_custom()

optsChanged(param, opts)[source]
Called when any options are changed that are not name, value, default, or limits.

If widget is a SpinBox, pass options straight through.
So that only the display label is shown when visible option is toggled.
Parameters Type Description
param instance of pyqtgraph parameter the parameter to check
opts string list the associated options list

See also

optsChanged()

treeWidgetChanged()[source]

Check for changement in the Widget tree.

class pymodaq.daq_utils.parameter.pymodaq_ptypes.TableViewCustom(menu=False)[source]
Attributes* Type
valuechanged instance of pyqt Signal
QtWidgets instance of QTableWidget
contextMenuEvent(self, QContextMenuEvent)[source]
get_table_value()[source]
set_table_value(data_model)[source]
class pymodaq.daq_utils.parameter.pymodaq_ptypes.TableViewParameter(**opts)[source]
Attributes Type
itemClass instance of TableParameterItem
Parameter instance of pyqtgraph parameter
itemClass

alias of TableViewParameterItem

setValue(value)[source]

Set the value of this Parameter; return the actual value that was set. (this may be different from the value that was requested)

class pymodaq.daq_utils.parameter.pymodaq_ptypes.ItemSelectParameterItem(param, depth)[source]
buttonClicked()[source]

Append to the param attribute the dictionnary obtained from the QtWidget add parameter procedure.

makeWidget()[source]
Make and initialize an instance of ItemSelect_pb with itemselect value.
Connect the created object with the buttonClicked function.
optsChanged(param, opts)[source]

Called when any options are changed that are not name, value, default, or limits.

See also

optsChanged()

treeWidgetChanged()[source]
class pymodaq.daq_utils.parameter.pymodaq_ptypes.ItemSelect_pb[source]
class pymodaq.daq_utils.parameter.pymodaq_ptypes.ItemSelect[source]
all_items()[source]

Get the all_items list from the self QtWidget attribute.

Returns:The item list.
Return type:list
get_value()[source]

Get the dictionnary of values contained in the QtWidget attribute.

Returns:The dictionnary of all_items compared to the slelectedItems.
Return type:dictionnary
set_value(values)[source]

Set values to the all_items attributes filtering values by the ‘selected’ key.

Parameters Type Description
values dictionnary the values dictionnary to be setted.
class pymodaq.daq_utils.parameter.pymodaq_ptypes.ItemSelectParameter(**opts)[source]

Editable string; displayed as large text box in the tree.

Attributes Type
itemClass instance of ItemSelectParameterItem
sigActivated instance of pyqt Signal
itemClass

alias of ItemSelectParameterItem

activate()[source]

Activate the “Activated” signal attribute0

class pymodaq.daq_utils.parameter.pymodaq_ptypes.file_browser(init_path='D:/Data', file_type=False)[source]
Attributes Type
value_changed instance of pyqt Signal
path string

See also

browse_path

browse_path()[source]

Browse the path attribute if exist.

See also

set_path()

get_value()[source]

Get the value of the base_path_edit attribute.

Returns:the path name
Return type:string
initUI()[source]

Init the User Interface.

set_path(path_file)[source]

Set the base path attribute with the given path_file.

Parameters Type Description
path_file string the pathname of the file
class pymodaq.daq_utils.parameter.pymodaq_ptypes.file_browserParameterItem(param, depth)[source]
makeWidget()[source]

Make an initialized file_browser object with parameter options dictionnary (‘readonly’ key)0

Returns:w – The initialized file browser.
Return type:filebrowser

See also

file_browser()

treeWidgetChanged()[source]

Called when this item is added or removed from a tree.

class pymodaq.daq_utils.parameter.pymodaq_ptypes.file_browserParameter(**opts)[source]

Editable string; displayed as large text box in the tree. .. seealso:: file_browserParameterItem

itemClass

alias of file_browserParameterItem

class pymodaq.daq_utils.parameter.pymodaq_ptypes.Plain_text_pbParameterItem(param, depth)[source]
makeWidget()[source]

Make and initialize an instance of Plain_text_pb object from parameter options dictionnary (using ‘readonly’ key).

Returns:The initialized object.
Return type:Plain_text_pb object

See also

Plain_text_pb(), buttonClicked()

treeWidgetChanged()[source]

Called when this item is added or removed from a tree.

class pymodaq.daq_utils.parameter.pymodaq_ptypes.Plain_text_pb[source]
Attributes Type
value_changed instance of pyqt Signal

See also

initUI, emitsignal

emitsignal()[source]

Emit the value changed signal from the text_edit attribute.

get_value()[source]

Get the value of the text_edit attribute.

Returns:The string value of text_edit.
Return type:string
initUI()[source]

Init the User Interface.

set_value(txt)[source]

Set the value of the text_edit attribute.

Parameters Type Description
txt string the string value to be setted
class pymodaq.daq_utils.parameter.pymodaq_ptypes.Plain_text_pbParameter(**opts)[source]

Editable string; displayed as large text box in the tree.

itemClass

alias of Plain_text_pbParameterItem

activate()[source]

Send the Activated signal.

class pymodaq.daq_utils.parameter.pymodaq_ptypes.TextParameterItemCustom(param, depth)[source]
class pymodaq.daq_utils.parameter.pymodaq_ptypes.TextParameter(**opts)[source]

Editable string; displayed as large text box in the tree.

itemClass

alias of TextParameterItemCustom