State:New|TargetRelease:No Target|icon_bug|icon_nuke|database:public|Resolution:Fixed|BugID:355573|
Problem summary
When setting up custom PySide UIs, using the 'setItemDelegateForColumn()' from the QtGui/QtWidgets module, Nuke will crash when opening the window.
One weird behaviour noted, is if the code is ran again in Nuke11 (Windows Only) , it will not crash when opening the window, but moving the scrollbar within the window will crash Nuke.
In versions Nuke10 and earlier, launching the window in a second GUI, will still crash when opening the window.
The issue appears to be regressed with Nuke7v10, although the window is slow to run.
Using setItemDelegate() does not cause the crashing behaviour and allows the window to be used.
Customer reported version
nuke.11.1v4
Customer reported platform
n_a_mac
Steps to reproduce
1) Open Nuke
2) Open the Script Editor tab and paste/execute the following script:
try:
from PySide2 import QtWidgets, QtCore
except(ImportError):
from PySide import QtCore
from PySide import QtGui as QtWidgets
class MyDelegate(QtWidgets.QStyledItemDelegate):
def __init__(self, parent=None):
super(MyDelegate, self).__init__(parent)
def paint(self, painter, option, index):
painter.drawText(option.rect,
index.data())
class MyModel(QtCore.QAbstractTableModel):
def __init__(self, node_list, parent=None):
super(MyModel, self).__init__(parent)
self.setNodes(node_list)
def setNodes(self, node_list):
self.nodes = node_list
def data(self, index, role):
return self.nodes[index.row()].name()
def columnCount(self, index=None):
return 3
def rowCount(self, index=None):
return len(self.nodes)
v = QtWidgets.QTableView()
model = MyModel(["hey","there","world"])
v.setModel(model)
v.setItemDelegateForColumn(0, MyDelegate())
# Workaround
#v.setItemDelegate(MyDelegate())
v.show()
Try moving the horizontal slider within the window.
# Workaround
#v.setItemDelegate(MyDelegate())
Be sure to comment out setItemDelegateForColumn() before executing the snippetWe're sorry to hear that
Please tell us why