<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Good Day to All,<br><br>Been writing code for years, but still a bit green when it comes to PyQt,<br>so please forgive my syntactically lacking question(s) ;-)<br><br>I'm hacking a derivative of the (famous?) packaged example that<br>comes with PyQt4 (and Qt), namely "basicsortfiltermodel.pyw"<br>from "../examples/itemviews" in PyQt4...<br><br>I've added a little popup menu (let's call this B.py) that one can launch<br>from the BasicSort-derivative (let's call this A.py).<br><br>I believe I'm correcting adding new data (a new record) to the<br>QSortFilterProxyModel(). (I think this because I'm not getting<br>any errors now, after some effort) But I seem to be unable to get<br>the QTreeView to refresh. I've scoured the Qt class docs and<br>Google'd the heck out of it (seems like a common question from<br>the looks of it, lol)..<br><br>Now
I know this is an ugly hack, but just to try to get it to work<br>(elegance can come later is my theory)...<br>At the bottom of A.py, I declared a global "wX",<br><br> global wX;<br><br> [...]<br> window = Window()<br> wX = Window()<br> window.setSourceModel(createMailModel(window))<br><br> so that when I hit a button later, I could more easily get a hold<br>of the "parent" value found in the runtime "createMailModel".<br>From which I get the "model" handle..<br><br> model = QtGui.QStandardItemModel(0, 17, WinX)<br><br> addMail(model, "image",<br>
"tabl00",<br> etc<br> etc)<br><br>Anyways,..I think this is working....<br>But after adding a new record via addMail(), I can't seem to get<br>self.proxyModel to refresh itself..<br><br>I'm pretty sure this a stupid newbie issue, lol....but could anyone<br>help shed some light on how to make this work?<br><br>Many Thanks,<br>-Jim<br></td></tr></table><br>