Hello,<div><br></div><div>I have subclassed <font class="Apple-style-span" face="'courier new', monospace">QAbstractTableModel</font>. 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).</div>
<div><br></div><div>Hence, I have decided to use <font class="Apple-style-span" face="'courier new', monospace">Qt.<span class="Apple-style-span" style="color: rgb(54, 53, 52); line-height: 13px; word-spacing: 5px; ">AccessibleDescriptionRole. </span></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="color: rgb(54, 53, 52); line-height: 13px; word-spacing: 5px; "><br></span></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="color: rgb(54, 53, 52); line-height: 13px; word-spacing: 5px; ">def data(self, index, role):</span></font></div>
<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="color: rgb(54, 53, 52); line-height: 13px; word-spacing: 5px; ">...stuff here...</span></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="color: rgb(54, 53, 52); line-height: 13px; word-spacing: 5px; "><br></span></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="color: rgb(54, 53, 52); line-height: 13px; word-spacing: 5px; ">if role == Qt.AccessibleDescriptionRole:</span></font></div>
</blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>
<font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="color: rgb(54, 53, 52); line-height: 13px; word-spacing: 5px; ">return "My information"</span></font></div>
</blockquote><font class="Apple-style-span" color="#363534" face="'courier new', monospace"><span class="Apple-style-span" style="line-height: 13px; word-spacing: 5px;"><br></span></font></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="color: rgb(54, 53, 52); line-height: 13px; word-spacing: 5px; "><br></span></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="color: rgb(54, 53, 52); line-height: 13px; word-spacing: 5px; "><br>
</span></font></div></blockquote><font class="Apple-style-span" color="#363534" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="line-height: 13px; word-spacing: 5px; ">Here is the method called when the user double clicks on the treeview : </span></font><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>
<font class="Apple-style-span" color="#363534" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="line-height: 13px; word-spacing: 5px; "><br></span></font></div><div><font class="Apple-style-span" color="#363534" face="'courier new', monospace"><span class="Apple-style-span" style="line-height: 13px; word-spacing: 5px; ">def file_clicked(self, index):</span></font></div>
<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><font class="Apple-style-span" color="#363534" face="'courier new', monospace"><span class="Apple-style-span" style="line-height: 13px; word-spacing: 5px; ">f_obj = index.child(index.row(), 0).data(Qt.AccessibleDescriptionRole).toString()</span></font></div>
<div><font class="Apple-style-span" color="#363534" face="'courier new', monospace"><span class="Apple-style-span" style="line-height: 13px; word-spacing: 5px; "><br></span></font></div><div><font class="Apple-style-span" color="#363534" face="'courier new', monospace"><span class="Apple-style-span" style="line-height: 13px; word-spacing: 5px; "><br>
</span></font></div></blockquote><font class="Apple-style-span" color="#363534" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="line-height: 13px; word-spacing: 5px; ">However, f_obj seems to be empty. I can't get the information returned by the AccessibleDescriptionRole.</span></font><div>
<font class="Apple-style-span" color="#363534" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="line-height: 13px; word-spacing: 5px; ">Do you have an idea about what am I doing wrong ?</span></font></div>
<div><font class="Apple-style-span" color="#363534" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="line-height: 13px; word-spacing: 5px; "><br></span></font></div><div><font class="Apple-style-span" color="#363534" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="line-height: 13px; word-spacing: 5px; ">Thank you,</span></font></div>
<div><font class="Apple-style-span" color="#363534" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="line-height: 13px; word-spacing: 5px; ">Gaêtan</span></font></div>