Thank you very much for the given answer.
My confusion came up by simply looking into the wrong app in the first place.
Now that I started working on the real thing, I ran into another problem:
My idea is to dynamically resize the single publishes in the history view so that the description text is always fully readable.
For that I tried to change the sizeHint() function inside the SgPublishHistoryDelegate class.
My experimental code looks like this:
def sizeHint(self, style_options, model_index):
sg_item = shotgun_model.get_sg_data(model_index)
desc_str = sg.item.get("description") or "No Description Given"
text_length = len(desc_str)
return QtCore.QSize( 200 , max( (text_length / 39) * 24, 100))
I noticed, that the model_index is always pointing to the same entry and therefore the description string is always the one of the first entry. As one would expect, the result is that every entry gets the height that only the first one should get.
So I bet there’s something about this whole process I don’t realy understand yet and couldn’t manage to find out myself till now despite reading the links philip gave me. Could someone help me with this?
Thanks again in advance!
Edit: I think the problem is, that QList Items arent variable in their size. Is there a known workaround for this working with the shotgun api?