ID 601177 - Nuke fails to convert QWidget object when using PyQt

Follow

Problem summary
Nuke fails to convert QWidget object when using PyQt. When trying to create a docked panel, the following error is returned:

TypeError: expecting a widget


Customer reported version
Nuke 15.2v1


Customer reported platform
Rocky 9


Steps to reproduce

1) Firstly, you will need to install PyQt5:

/usr/local/Nuke15.2v1/python3 -m pip install PyQt5


2) Open Nuke.

3) Run the following code in the Script Editor:

import nuke from nukescripts import panels from PyQt5 import QtWidgets, QtCore class NukeTestWindow(QtWidgets.QWidget):     def __init__(self, parent=None):         QtWidgets.QWidget.__init__(self, parent)         self.setLayout(QtWidgets.QVBoxLayout())         self.layout().addWidget(QtWidgets.QLabel("Test")) panel = panels.registerWidgetAsPanel('NukeTestWindow', 'Test panel', 'uk.co.thefoundry.NukeTestWindow', True) pane = nuke.getPaneFor('Properties.1') # The following line raises with PyQt5: panel.customKnob.makeWidget() panel.addToPane(pane)


Expected behaviour
This should create a docked panel, like it used to in previous Nuke versions and also when using PySide2.


Actual behaviour
The following error is returned:

TypeError: expecting a widget


Workaround
Unknown. 


Reproduced by support
This issue has been identified by our developers in Nuke 15.1 and Nuke 15.2.

    We're sorry to hear that

    Please tell us why