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.
editingFinished(list)
This signal is emitted when editing of the input field is finished which occurs when the Return or Enter key is pressed or the input field loses focus. The first parameter is the new value added.
ladderChanged()
This signal is emitted when the value stored in the input field has been changed by the ladder.
Methods ¶
__init__(data_type, num_components, label=None, size_policy=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.
height_size_policy
Specifies the size policy for the widget. None
by default.
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.
setAlignment(alignment)
Set the text alignment for all of the components' fields
alignment
/hom/hou/qt/QtCore.Qt.Alignment.html to specify the text alignment.
setValidator(validator)
Assigns a /hom/hou/qt/QtCore.QGui.QValidator.html object for all of the components fields to validate the input. See the Qt documentation for details on how to use a validator.
validator
A /hom/hou/qt/QtCore.QGui.QValidator.html object. The validator type must match the underlying InputField’s data type or an exception is raised. For instance, the method expects a /hom/hou/qt/QtCore.QGui.QDoubleValidator.html type if the InputField type is /hom/hou/qt/hou.qt.InputField.html#FloatType.
setWidth(width)
Set the width for the all of the components' fields.
width
The width value in UI coordinates.
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).
onContextMenuEvent(event, context_menu)
Optional callback for customizing the hou.qt.InputField
contextual menu. Typically used with a class deriving from hou.qt.InputField
.
event
Qt menu event object.
onMousePressEvent(event)
Optional callback for customizing the behavior of hou.qt.InputField
mouse press event. Typically used with a class deriving from hou.qt.InputField
.
onMouseWheelEvent(event)
Optional callback for customizing the behavior of hou.qt.InputField
mouse wheel event. Typically used with a class deriving from hou.qt.InputField
.