Houdini 17.0 Python Scripting hou hou.qt

hou.qt.floatingPanelWindow HOM function

Return a QWidget instance representing the window for the specified floating panel.

floatingPanelWindow(self, panel) QWidget

Return a QWidget instance representing the window for the provided hou.FloatingPanel. If the provided panel is None, this method returns the mainWindow. This method is helpful for parenting a PySide or PyQt dialog to a particular floating panel. Parenting to a panel keeps the dialog alive for the lifetime of the panel so that the dialog is not destroyed prematurely by Python. Parenting also causes the dialog to inherit the Houdini style sheet set on the main window, and depending on the dialog configuration, can keep the dialog on top of the floating panel.

Here is an example of parenting a dialog to the panel that contains a particular pane tab:

from hutil.Qt import QtCore

panetab = hou.ui.findPaneTab('panetab1')
panel = panetab.pane().floatingPanel()
dialog = MyDialog()
dialog.setParent(hou.qt.floatingPanelWindow(panel), QtCore.Qt.Window)