On Mon, 21 Feb 2011 21:30:28 +0100, Andreas Pakulat <[email protected]> wrote:
> Hi,
> 
> still working on the modeltest.py code, picking up one of the older
> threads about it:
> 
http://www.opensubscriber.com/message/[email protected]/10335500.html
> 
> As far as I can see the reason for this is the casting done at the start
> of the ModelTest class. It looks like sip.cast changes the behaviour of
> comparing the references in this code:
> 
> assert( index.model() == self.model )
> 
> index.model() is a QStringListModel instance, self.model is a
> QAbstractItemModel and both have different internal id's.
> 
> And it seems like sip.cast creates a new wrapped instance each time,
> simply doing a sip.cast() for the index.model() call does not help.

sip.cast() creates a new Python object (with a different type) for the
same C++ instance. That means that a different C++ implementation of an
operator may be called.

> Is that intentional (I guess so) and is there a way to still get the
> assertion to work as it should?
> 
> Andreas

Phil
_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to