API Documentation¶
Form¶
-
class
psforms.form.
Form
¶ -
classmethod
as_dialog
(frameless=False, dim=False, parent=None)¶ Get this form as a dialog
-
classmethod
as_widget
(parent=None)¶ Get this form as a widget
-
columns
= 1¶
-
classmethod
create
(parent=None)¶ Create a widget for this form using all Field attributes
-
description
= None¶
-
header
= False¶
-
icon
= None¶
-
labeled
= True¶
-
labels_on_top
= True¶
-
title
= None¶
-
classmethod
Fields¶
-
class
psforms.fields.
BoolField
(name, label_on_top=False, **kwargs)¶ Represented by a
CheckBox
control.Parameters: - name – Nice name of the field (str)
- default – Default value (str)
-
control_cls
= <Mock spec='str' id='140544332813904'>¶
-
class
psforms.fields.
Field
(name, labeled=None, label_on_top=None, default=None)¶ Form
calls thecreate()
to retrieve an appropriate control.Parameters: - name – Nice name of the field (str)
- labeled – Field Control has label (bool) Overrides the parent Forms labeled attribute for this field only
- label_on_top – Label appears on top of the field control (bool) Overrides the parent Forms label_on_top attribute for this field only
- default – Default value (str)
-
class
psforms.fields.
Float2Field
(name, range1=None, range2=None, **kwargs)¶ Represented by a
TwinDoubleSpinBox
control.Parameters: - name – Nice name of the field (str)
- range1 – Tuple of minimum and maximum values
- range2 – Tuple of minimum and maximum values
- default – Default value (float)
-
control_cls
= <Mock spec='str' id='140544332779408'>¶
-
class
psforms.fields.
FloatField
(name, range=None, **kwargs)¶ Represented by a
DoubleSpinBox
control.Parameters: - name – Nice name of the field (str)
- range – Tuple of minimum and maximum values
- default – Default value (float)
-
control_cls
= <Mock spec='str' id='140544332779152'>¶
-
class
psforms.fields.
Int2Field
(name, range1=None, range2=None, **kwargs)¶ Represented by a
TwinSpinBox
control.Parameters: - name – Nice name of the field (str)
- range1 – Tuple of minimum and maximum values
- range2 – Tuple of minimum and maximum values
- default – Default value (float, float)
-
control_cls
= <Mock spec='str' id='140544332812880'>¶
-
class
psforms.fields.
IntField
(name, range=None, **kwargs)¶ Represented by a
SpinBox
control.Parameters: - name – Nice name of the field (str)
- range – Tuple of minimum and maximum values
- default – Default value (int)
-
control_cls
= <Mock spec='str' id='140544332812624'>¶
-
class
psforms.fields.
IntOptionField
(name, options, **kwargs)¶ Represented by an
IntComboBox
control.Parameters: - name – Nice name of the field (str)
- options – List of options
- default – Default value (int)
-
control_cls
= <Mock spec='str' id='140544332813520'>¶
-
class
psforms.fields.
ListField
(name, labeled=None, label_on_top=None, default=None)¶ Represented by a
List
controlParameters: - name – Nice name of field (str)
- default – Default value (list of strings)
-
control_cls
= <Mock spec='str' id='140544332814672'>¶
Controls¶
psforms.controls¶
Wraps standard PySide input widgets providing a unified api for getting and
setting their values. Each control implements get_value()
and
set_value()
. A required position argument value
or
values
is used to set the default value of the control or in the case
of ComboBox
and IntComboBox
a sequence of items to add to
the wrapped QComboBox. In addition each control emits a Signal named changed
whenever the value is changed by user interaction.