Houdini 20.0 Python scripting hou hou.qt

hou.qt.styleSheet HOM function

Return the Houdini style sheet.

styleSheet(file_path=None) str

If file_path is not None, then return the style sheet stored in the given file rather than the Houdini style sheet. Style placeholders, such as color placeholders (i.e. @MenuBG@) and scaled size placeholders (i.e. @14px@), are evaluated and expanded in the returned style sheet.

Return an empty string if the specified file path does not exist or if there is a syntax error in the style sheet.

The returned style sheet can be applied to Qt widgets. Note that child widgets automatically inherit the parent widget’s style sheet.

import Qt.QtWidgets as QtWidgets

# Get the Houdini style sheet.
stylesheet = hou.qt.styleSheet()

# Apply the Houdini style to a widget.
parent_widget = QtWidgets.QWidget()

child_button = QtWidgets.QPushButton()
child_button.setText("Hello World")

# Parenting the child button inherits the parent's Houdini style sheet.