State:New|TargetRelease:No Target|icon_bug|icon_nuke|database:public|Resolution:Fixed|BugID:361764|
Problem summary
Nuke crashes when inputting the command QHeaderView.setSectionResizeMode(int, QtWidgets.QHeaderView.Stretch) in the Script Editor.
This includes any property for theQtWidgets.QHeaderViewsuch as:
QtWidgets.QHeaderView.Interactive, QtWidgets.QHeaderView.Fixed, or QtWidgets.QHeaderView.ResizeToContents
Customer reported version
nuke.n/a
Customer reported platform
nuke11.2v3
Steps to reproduce
1) Launch Nuke and open a Script Editor panel.
2) Copy/paste the following code:
from PySide2 import QtWidgets, QtCore
class MyTableView(QtWidgets.QTableView):
SECTION_SIZE = 70
def __init__(self, parent=None):
super(MyTableView, self).__init__(parent)
SS_no_selection_border = '''QTableView::item {outline: none}'''
self.setStyleSheet(SS_no_selection_border)
self.setSelectionMode(QtWidgets.QAbstractItemView.NoSelection)
self.setFrameStyle(QtWidgets.QFrame.NoFrame)
self.setAlternatingRowColors(True)
self.setGridStyle(QtCore.Qt.PenStyle.NoPen)
self.setSortingEnabled(True)
self.verticalHeader().setDefaultSectionSize(self.SECTION_SIZE)
self.verticalHeader().hide()
#### this crashes nuke on the second nukescripts.registerWidgetAsPanel() command:
self.horizontalHeader().setSectionResizeMode(4, QtWidgets.QHeaderView.Stretch)
class MyModel(QtCore.QAbstractTableModel):
def __init__(self, parent=None):
super(MyModel, self).__init__(parent)
self.header_labels = ['Thumbnail', 'File name', 'Version', 'Read name', 'Status', 'Show']
self.data_ = range(10)
def data(self, index, role):
if role == QtCore.Qt.DisplayRole:
return self.data_[index.row()]
def rowCount(self, index=None):
return len(self.data_)
def columnCount(self, index=None):
return len(self.header_labels)
w = nukescripts.registerWidgetAsPanel('MyTableView', 'MyTableView', 'com.ohufx.LocalizePanel', create=True)
w.show()
3) Run the Python script and observe stability.
Workaround
Unknown.
Reproduced by support
This bug has been reproduced in:
Nuke 11.2v3 - Windows 10, CentOS 7, macOS 10.13
Nuke 11.2v1 - Windows 10
Nuke 11.1v5 - Windows 10
Nuke 11.1v1 - Windows 10
Nuke 11.0v4 - Windows 10
Nuke 11.0v1 - Windows 10, CentOS 7
Unable to reproduce bug in:
Nuke 10.5v7
Earliest version tested
Nuke 10.5v7 - This feature did not exist before this version
Expected behaviour
The Python command to work.
Actual behaviour
Nuke crashes.
We're sorry to hear that
Please tell us why