QPW Widgets#

QPW Widgets

This Python module provides classes for creating user interface widgets in PyQt5 for inputting parameters. The module defines classes such as QPW_CheckBox, QPW_Choice, QPW_SpinBox, and QPW_Text that inherit from the``QPW_Mixin`` class.

The QPW_Mixin class implements common functionality such as setting and getting widget values, checking if widget values have changed, and setting up tooltip text. The methods added by the QPW_Mixin class are prefixed with qpw_ to avoid replacing methods from the parent Qt widget class.

These widgets can be instantiated and used in a PyQt5 GUI to provide a way for users to input values for various parameters.

UNDEFINED_VALUE

For comparison with user input, avoids comparison with an explicit value.

QPW_CheckBox(*args, **kwargs)

Widget type for checkbox or boolean parameter.

QPW_Choice(*args, **kwargs)

Widget type for picking from a list.

QPW_SpinBox(*args, **kwargs)

Widget type for adjusting a number between limits.

QPW_Mixin(*args[, parameter])

Mixin class for all QPW widgets.

QPW_Text(*args, **kwargs)

Widget type for editing as text.

Note

The QPW_ prefix: pyQParamWidget

see:

https://www.pythonguis.com/tutorials/pyqt-dialogs/

class pyQParamWidget.qpw_widgets.QPW_CheckBox(*args: Any, **kwargs: Any)[source]#

Widget type for checkbox or boolean parameter.

qpw_get()

Return the value from the widget.

qpw_isChanged()

Is the widget value different than the original?

qpw_set(value)

Set the widget's value.

qpw_setup(pitem, slot)

Widget-specific setup details.

qpw_get()[source]#

Return the value from the widget.

qpw_set(value)[source]#

Set the widget’s value.

qpw_setup(pitem, slot)[source]#

Widget-specific setup details.

PARAMETERS

  • pitem (obj): ParameterItem instance

  • slot (obj): Function (Qt slot) to call when widget value changes. Connect signal and slot in a subclass as needed since each widget class has a different name for the signal to be used.

class pyQParamWidget.qpw_widgets.QPW_Choice(*args: Any, **kwargs: Any)[source]#

Widget type for picking from a list.

qpw_get()

Return the value from the widget.

qpw_isChanged()

Is the widget value different than the original?

qpw_set(value)

Set the widget's value.

qpw_setup(pitem, slot)

Widget-specific setup details.

qpw_get()[source]#

Return the value from the widget.

qpw_set(value)[source]#

Set the widget’s value.

qpw_setup(pitem, slot)[source]#

Widget-specific setup details.

PARAMETERS

  • pitem (obj): ParameterItem instance

  • slot (obj): Function (Qt slot) to call when widget value changes. Connect signal and slot in a subclass as needed since each widget class has a different name for the signal to be used.

class pyQParamWidget.qpw_widgets.QPW_Mixin(*args, parameter=None, **kwargs)[source]#

Mixin class for all QPW widgets.

qpw_get()

Return the value from the widget.

qpw_isChanged()

Is the widget value different than the original?

qpw_set(value)

Set the widget's value.

qpw_setup(pitem, slot)

Widget-specific setup details.

original_type#

Python object type to cast widget values.

alias of object

parameters#

ParameterItemBase object (passed by parent).

alias of object

qpw_get()[source]#

Return the value from the widget.

qpw_isChanged()[source]#

Is the widget value different than the original?

qpw_set(value)[source]#

Set the widget’s value.

qpw_setup(pitem, slot)[source]#

Widget-specific setup details.

PARAMETERS

  • pitem (obj): ParameterItem instance

  • slot (obj): Function (Qt slot) to call when widget value changes. Connect signal and slot in a subclass as needed since each widget class has a different name for the signal to be used.

class pyQParamWidget.qpw_widgets.QPW_SpinBox(*args: Any, **kwargs: Any)[source]#

Widget type for adjusting a number between limits.

qpw_get()

Return the value from the widget.

qpw_isChanged()

Is the widget value different than the original?

qpw_set(value)

Set the widget's value.

qpw_setup(pitem, slot)

Widget-specific setup details.

qpw_get()[source]#

Return the value from the widget.

qpw_set(value)[source]#

Set the widget’s value.

qpw_setup(pitem, slot)[source]#

Widget-specific setup details.

PARAMETERS

  • pitem (obj): ParameterItem instance

  • slot (obj): Function (Qt slot) to call when widget value changes. Connect signal and slot in a subclass as needed since each widget class has a different name for the signal to be used.

class pyQParamWidget.qpw_widgets.QPW_Text(*args: Any, **kwargs: Any)[source]#

Widget type for editing as text.

qpw_get()

Return the value from the widget.

qpw_isChanged()

Is the widget value different than the original?

qpw_set(value)

Set the widget's value.

qpw_setup(pitem, slot)

Widget-specific setup details.

qpw_get()[source]#

Return the value from the widget.

qpw_set(value)[source]#

Set the widget’s value.

qpw_setup(pitem, slot)[source]#

Widget-specific setup details.

PARAMETERS

  • pitem (obj): ParameterItem instance

  • slot (obj): Function (Qt slot) to call when widget value changes. Connect signal and slot in a subclass as needed since each widget class has a different name for the signal to be used.

pyQParamWidget.qpw_widgets.UNDEFINED_VALUE#

For comparison with user input, avoids comparison with an explicit value.