[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt]
From:       "Dan Halbert" <halbert () halwitz ! org>
Date:       2010-10-28 13:08:16
Message-ID: 1288271296.771913291 () 192 ! 168 ! 2 ! 229
[Download RAW message or body]

On Thursday, October 28, 2010 8:28am, "Hans Meine" <meine@informatik.uni-hamburg.de> said:
> I am about to give up now, but first I want to post my current code again; I
> added some assertions which show an interesting fact which I have no
> explanation for:  One assertion fails, since I am getting a QModelIndex of my
> proxy model in which internalPointer does *not* contain a QModelIndex of the
> proxied model anymore, but NULL/None.

There have been some related discussions on the mailing list you might take a look at, for \
instance: http://www.riverbankcomputing.com/pipermail/pyqt/2006-July/thread.html#13786. Google \
[ site:riverbankcomputing.com internalpointer ] to find some more.

It might also be interesting to rewrite your Python code in the corresponding C++ and see if \
you see similar behavior.

In my limited use of proxy models, I have not found it useful to store QModelIndex objects in \
the internalPointer(). Instead I have created some "proxy data objects" that reference the \
actual data model (which is Qt-independent). I subclassed QSortFilterProxyModel since it \
implemented a bunch of stuff I would otherwise have had to reimplement.

I would also note that your proxy model did not implement mapToSource() and mapFromSource() as \
required, though I don't think they would be called in the simple example you posted.

Dan




_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic