[PyQt] 2 Updates for the modeltest in PyQt4

Andreas Pakulat apaku at gmx.de
Mon Feb 21 20:53:34 GMT 2011


On 20.02.11 23:52:13, Wolfgang Rohdewald wrote:
> On Sonntag 20 Februar 2011, Andreas Pakulat wrote:
> > I didn't test yet against an actual model, so might have done
> > something wrong in porting.
> 
> yep.
> 
> lists have no add, it is append
> 
> I didn't test either but pylint did
>
> Where do you maintain modeltest.py?
> 
> I got it from
> http://bazaar.launchpad.net/~bzr/ubuntu/maverick/qbzr/bzr-
> ppa/annotate/head:/lib/tests/modeltest.py
[...]
> my version, now with your patches:
> svn cat 
> svn://anonsvn.kde.org/home/kde/trunk/KDE/kdegames/kajongg/src/modeltest.py

Now did a closer look at the diff between that version of mine, the
attached 3 patches (one is the add vs. append change) contain the
changes.

> I made a few bug fixes and I believe I mailed them back to
> the author but now that I check again not all of them made
> it in, there are still some self. missing in front of model.*

Couldn't find any of those, just a self. missing in front of insert.

> also, checking values for TextAlignmentRole is still  wrong
> there: it does not accept ORed values

Can you elaborate on this?

> I also changed some things to make pylint happy
> (my local git commit hook does not let me commit unless pylint is 
> silent)

Thats probably all those name-changes and line-breaks etc?

There's one change that I don't quite understand though. Its the "Check
that we can get back our real parent", your version does:

parentIdx = self.model.parent( index )
assert( parentIdx.internalId() == parent.internalId() )
assert( parentIdx.row() == parent.row() )

while the PyQt version just compares the index against the stored one. Do you
have any idea why that was done in qbzr (the log message there is less than
useful).

Andreas

-- 
Living your life is a task so difficult, it has never been attempted before.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-running-lists-only-know-append.patch
Type: text/x-diff
Size: 900 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110221/51e99f01/attachment-0003.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Fix-this-assert-to-not-automatically-trigger.patch
Type: text/x-diff
Size: 1529 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110221/51e99f01/attachment-0004.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Add-self-here.patch
Type: text/x-diff
Size: 1290 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110221/51e99f01/attachment-0005.patch>


More information about the PyQt mailing list