[PyQt] Qtreeview and Qt.AccessibleDescriptionRole

Gaëtan Podevijn gpodevij at gmail.com
Wed Feb 16 13:30:43 GMT 2011


Hello,

I have subclassed QAbstractTableModel. I have define my data method
correctly. However, I would like to get a kind of "hidden information" when
I double clicked on the view associated to my model (which is a qtreeview).

Hence, I have decided to use Qt.AccessibleDescriptionRole.

def data(self, index, role):

...stuff here...

if role == Qt.AccessibleDescriptionRole:

return "My information"




Here is the method called when the user double clicks on the treeview :

def file_clicked(self, index):

f_obj = index.child(index.row(),
0).data(Qt.AccessibleDescriptionRole).toString()


However, f_obj seems to be empty. I can't get the information returned by
the AccessibleDescriptionRole.
Do you have an idea about what am I doing wrong ?

Thank you,
Gaêtan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110216/2860b771/attachment.html>


More information about the PyQt mailing list