4.5. Base widget class

Each PyDADL widget inherits from two classes : a Qt class and the Base class. The following elements are common to all widgets :

Widget's attributes

Widget's attributes are specified upon the creation of the widget object, either in the widget tag of the dialog XML file or passed in the data argument of function addWidget.

value
Widget's initial value. When specified, the function setValue is called to set the initial value.
layout
Horizontal and vertical layout resizing policy, possible values are :
none
The widget's size is ignored, it will get as much space as possible.
fixed
The widget's size is the only acceptable alternative, so the widget can never grow or shrink.
min
The widget's size is minimal, and sufficient, it can be expanded, but there is no advantage to it being larger. It cannot be smaller.
max
The widget's size is a maximum, it can be shrunk by any amount without detriment if other widgets need the space. It cannot be larger.
pref
The widget's size is best, but it can be shrunk and still be useful. The widget can be expanded, but there is no advantage to it being larger.
exp
The widget's size is a sensible size, but it can be shrunk and still be useful. The widget can make use of extra space, so it should get as much space as possible.
min_exp
The widget's size is minimal, and sufficient. The widget can make use of extra space, so it should get as much space as possible.
h_layout
Horizontal layout resizing policy.
v_layout
Vertical layout resizing policy.
width
Widget's width.
height
Widget's height.
l_align
This attribute holds the layout alignment of the widget. Possible values are : left, right, top, bottom, center, hcenter, vcenter, justify.
whatsthis
Widget's what's this text.
tooltip
Widget's tooltip.
disabled
If this attribute is set to False, the widget will not receive keyboard and mouse events.
visible
If this attribute is set to False, the widget will be hidden.
buttons
This value is formed with names of button widgets separated by commas that will be enabled or disabled via the enableButtons function.
muted
If this attribute is set to True, the widget value will not be included in the dict passed to the dialog's callback function.
track_changes
If this attribute is set to False, the widget changes will not put the dialog in an applyable state. The widget still emit the changed signal.

Widget's functions

setValue(value)
Set the widget's value to value.
getValue()
Get the widget's value.
enableButtons(enabled)
Set the associated buttons enabled state to enabled.

Widget's signals

changed(value)
This signal is emitted when the content of the widget changes. value is the current widget's value.