[PyQt] refreshing QTreeView

James Polk jpolk5001 at yahoo.com
Thu Nov 18 22:30:14 GMT 2010


...well in a burst of inspiration, or was that the caffeine,...I hit upon
something that works....essentially bypassing the middleman, so to speak...instead of calling  addMail(),...I just do what addMail does/
did before...
So, now,..my code snippet looks like this

def addNewRecord(self):
    print("adding new record")
    dialog = popup.AddNewRecordDialog(self.record,self)
    if dialog.exec_():
            self.record = dialog.DoIt()
            print(self.record)
            recPart = self.record.split(",")
            self.proxyModel.insertRow(0)
            self.proxyModel.setData(self.proxyModel.index(0,  0), recPart[0])
            self.proxyModel.setData(self.proxyModel.index(0,  1), recPart[1])
            self.proxyModel.setData(self.proxyModel.index(0,  2), recPart[2])
            etc
            etc

...so this works, but ideally so,....It appears to overwrite some
data in the model,...but when I change filter settings and the
model refreshes, I can see all the data now....so, still some work
to do...<sigh>

...and I'm still a little fuzzy about how Python handles modules,
namespaces, and passing data around to functions...







      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20101118/d5a182a0/attachment.html>


More information about the PyQt mailing list