On this page |
The input field is designed to look like the Houdini input fields that appear
in the Parameters pane. The field supports the click value ladder.
This class inherits from Qt’s QtWidgets.QWidget
class.
Enums
Type
This enumeration specifies an input field’s data type.
.IntegerType
Integer data type.
.FloatType
Float data type.
.StringType
String data type.
Signals
valueChanged()
This signal is emitted when the value stored in the input field has changed.
hotkeyInvoked(str)
This signal is emitted when a hotkey is invoked. The first parameter is the hotkey symbol that was invoked.
Methods
__init__(data_type, num_components, label=None)
Create and return a new input field that has num_components
line edit
fields for the given data type.
data_type
Must be a hou.qt.InputField.Type enumeration value.
num_components
Must be an integer between 1 and 4 inclusive.
label
Text that will appear beside the input field. If None then no label will be shown.
setValue(value, index=0)
Set the value for the component at index
.
index
The vector component index. For scalars this would default to 0.
Raise an AssertionError if the value’s data type does not match the input field’s data type.
Raise an AssertionError if the index is outside the range of components (i.e. index must be greater than or equal to 0 and less than the number of components in the field).
setValues(values)
Sets the field’s values. This is a convenience method for setting all of the field’s values in one call.
values
Either a tuple or list of values.
Raise an AssertionError if any values in values
do not match
the input field’s data type.
Raise an AssertionError if the number of items in values
is not
equal to the number of components in the input field.
value(index=0)
→ int
, float
or str
Return the value for the component at index
.
index
The vector component index. For scalars this would default to 0.
Raise an AssertionError if the index is outside the range of components (i.e. index must be greater than or equal to 0 and less than the number of components in the field).
values()
→ tuple of int
, float
or str
Return all of the values in the input field.
setMenu(menu)
Set this widget’s context menu. The context menu is applied to all components' fields.
menu
QtWidgets.QMenu object to be applied to this widget.
setAlignment(alignment)
Set the text alignment for the all of the components' fields
alignment
/hom/hou/qt/QtCore.Qt.Alignment to specify the text alignment.
setState(state_name, state_value, index=0)
Sets the field’s state_value for the named state at index
.
state_name
An arbitrary state name string.
state_value
A bool value for the state.
index
The vector component index. For scalars this would default to 0.
Raise an AssertionError if the index is outside the range of components (i.e. index must be greater than or equal to 0 and less than the number of components in the field).
state(state_name, index=0)
→ bool
Return the value of the named state for the component at index
.
state_name
An arbitrary state name string.
index
The vector component index. For scalars this would default to 0.
Raise an AssertionError if the index is outside the range of components (i.e. index must be greater than or equal to 0 and less than the number of components in the field).