Thanks, Mark, upon looking for a way to debug, I got another (clean and simple) idea:<div><br></div><div><div> def onTableRowSelected(self, index):</div><div> if index.isValid():</div><div> >>> index0 = self.proxyModel.index(index.row(), 0) <<<</div>
<div> qvar = self.proxyModel.itemData(index0)</div><div> qst_ip_addr = qvar[0].toString()</div><div> self.onDraw(qst_ip_addr)</div><div> else:</div><div> print "WW: invalid index in table model!"</div>
<div><br></div><div>But your answer will for sure save me hours of pain in the next couple of weeks.</div><div>Thanks.</div><br><div class="gmail_quote">On Fri, Feb 27, 2009 at 6:41 PM, Mark Summerfield <span dir="ltr"><mark@qtrac.eu></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="Ih2E3d">On 2009-02-27, Zorg 421 wrote:<br>
> Hello PyQt users, I do not know how to use the third argument of<br>
> createIndex in the following code.<br>
<br>
</div>I didn't have time to look at your code, but the third argument must be<br>
a QModelIndex, specifically the model index of the relevant item's<br>
_parent_. For top-level items this is easy: QModelIndex(); but inside<br>
the method using index.parent() should work fine.<br>
<font color="#888888"><br>
<br>
--<br>
Mark Summerfield, Qtrac Ltd, www.qtrac.eu<br>
C++, Python, Qt, PyQt - training and consultancy<br>
"Programming in Python 3" - ISBN 0137129297<br>
<br>
</font></blockquote></div><br></div>