[Interest] crash when using multiple setSectionResizeMode() calls in QTableView

Marian Beermann public at enkore.de
Mon Aug 13 12:10:34 CEST 2018


I tried your setSectionResizeMode snippet on a table model
whose headerData() is the same as yours and it doesn't cause a crash for
me. I don't think the other roles are required (at least to not have a
crash).

On 13.08.2018 11:30, Frank Rueter | OHUfx wrote:
> Thanks. My header data simply looks like this:
> 
> |def headerData(self, section, orientation, role): if orientation ==
> QtCore.Qt.Horizontal: if role == QtCore.Qt.DisplayRole: return
> self.header_labels[section] |
> 
> where: self.header_labels just contains a list of strings.
> 
> I guess I need to implement size hint roles?! I will try that tomorrow.
> 
> Tanks for the tip!
> 
> Cheers,
> frank
> 
> 
>> Must be something in your code; I'd start by double-checking everything
>> related to the header data in your model.
>>
>> -Marian
>>
>> On 13.08.2018 05:17, Frank Rueter | OHUfx wrote:
>>> Hi all,
>>>
>>> using PySide2 I am trying to set different resize modes for each of my
>>> columns in a table view, but as soon as I set more than one I get a crash.
>>>
>>> Here is what I do:
>>>
>>> |class MyView(QtWidgets.QTableView): def __init__(self, parent=None):
>>> super(MyView, self).__init__(parent) header = self.horizontalHeader()
>>> header.setSectionResizeMode(0, QtWidgets.QHeaderView.Fixed)
>>> header.setSectionResizeMode(1, QtWidgets.QHeaderView.Interactive) |
>>>
>>> Is this a bug or am I doing something wrong?
>>>
>>> Cheers,
>>> frank
>>>
>>>>>>
>>> -- 
>>>
>>> ohufxLogo 50x50 <http://www.ohufx.com> 	
>>> 	*vfx compositing <http://ohufx.com/compositing.html> | *workflow
>>> customisation and consulting <http://ohufx.com/customising.html>* *
>>>   	  	*<http://ohufx.com/compositing.html>*
>>> <http://www.nukepedia.com/nubridge> 	
>>> 	
>>>
>>> Your gateway to over 1,000 free tools... right inside of Nuke
>>> <http://www.nukepedia.com/nubridge>
>>>
>>>
>>>
>>> _______________________________________________
>>> Interest mailing list
>>> Interest at qt-project.org
>>> http://lists.qt-project.org/mailman/listinfo/interest
>>>
>



More information about the Interest mailing list