[PyQt] Model/View programming

Lukas Hetzenecker LuHe at gmx.at
Mon Sep 21 12:20:33 BST 2009


Hello,

i have some problems with my first attempt to use Model/View programming:

I tried to create a Model for a directory list. The folders are located on a 
mobile phone and I get the content over Obex and Bluetooth, so the 
communication can be really slow -> The model should be asynchronous.

When I get a reply from the phone (some items) I don't know how to get the 
parent QModelIndex for the directory (internal pointer). Currently I store the 
index in my internal class and update it on every createIndex call - is there 
any better solution?
But this doesn't even work, I can't append the child item (it isn't shown in 
the view). Can anybody look at my example and show me the right way?

Thanks,
Lukas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: modelview.py
Type: text/x-python
Size: 6075 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090921/0fc2fc18/modelview.py


More information about the PyQt mailing list