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

2018-08-15 Thread Frank Rueter | OHUfx
Ha, you are a star! I will try that first thing in the morning! Thanks! frank On 15/08/18 9:30 PM, Marian Beermann wrote: Hi Frank, I didn't spot it earlier, but now I saw it. You're manipulating QHeaderView's sections before setting the model on the view. Most things you can do with a QHeader

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

2018-08-15 Thread Marian Beermann
Hi Frank, I didn't spot it earlier, but now I saw it. You're manipulating QHeaderView's sections before setting the model on the view. Most things you can do with a QHeaderView require a model to be present. If you move these calls to after a model has been set, everything works. https://gist.gi

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

2018-08-14 Thread Frank Rueter | OHUfx
Hi, I isolated the problem into a small snippet: https://gitlab.com/snippets/1744780 This still crashes for me. I do get the result I’m after by only setting one resize mode, i.e.: |header.setSectionResizeMode(5, QtWidgets.QHeaderView.Fixed) | However, what I’m really after is the behaviour o

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

2018-08-13 Thread Frank Rueter | OHUfx
Thanks for testing Marian, much appreciated! Interesting it won't crash for you. I will try it in a different IDE (using WingIDE normally) and a different machine in case there is something wrong with my install. Cheers, frank On 13/08/18 10:10 PM, Marian Beermann wrote: I tried your setSect

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

2018-08-13 Thread Marian Beermann
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

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

2018-08-13 Thread Frank Rueter | OHUfx
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 implem

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

2018-08-13 Thread Marian Beermann
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 a

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

2018-08-12 Thread Frank Rueter | OHUfx
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 = sel