alexandernst
5th August 2009, 22:29
[PYTHON]
I have a def
def sizeHint(self, option, index)
witch receives 2 args, QStyleOptionViewItem and QModelIndex. (its a reimplementation of sizeHint, for drawing items in a qtreeview).
As you can guess, I can't access the model where I have all the data because the def is located in another class. So, the question is, ¿how can I get the data of certain column, at the row from the "index" value, having the qmodelindex?
I have been looking at the docs, and I can do a index.model() witch will return me a QAbstractItemModel, but I got stuck there.
What should I do? Should I access the model from the other class? If there is a way of doing what I want to do without having to access the model from the another class it will be better.
Thanks
I have a def
def sizeHint(self, option, index)
witch receives 2 args, QStyleOptionViewItem and QModelIndex. (its a reimplementation of sizeHint, for drawing items in a qtreeview).
As you can guess, I can't access the model where I have all the data because the def is located in another class. So, the question is, ¿how can I get the data of certain column, at the row from the "index" value, having the qmodelindex?
I have been looking at the docs, and I can do a index.model() witch will return me a QAbstractItemModel, but I got stuck there.
What should I do? Should I access the model from the other class? If there is a way of doing what I want to do without having to access the model from the another class it will be better.
Thanks