[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] 2 Updates for the modeltest in PyQt4
From: Wolfgang Rohdewald <wolfgang () rohdewald ! de>
Date: 2011-02-21 22:50:24
Message-ID: 201102212350.25016.wolfgang () rohdewald ! de
[Download RAW message or body]
On Montag 21 Februar 2011, Andreas Pakulat wrote:
> 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.
in rowsAboutToBeInserted and rowsInserted,
rowsAboutToBeRemoved and rowsRemoved, several places
similar to
self.model.data(model.index(...
that should be self.model.index
> > also, checking values for TextAlignmentRole is still wrong
> > there: it does not accept ORed values
>
> Can you elaborate on this?
diff between launchpad.net file and mine:
- assert( alignment == QtCore.Qt.AlignLeft or
- alignment == QtCore.Qt.AlignRight or
- alignment == QtCore.Qt.AlignHCenter or
- alignment == QtCore.Qt.AlignJustify)
+ assert( alignment == (alignment &
int(QtCore.Qt.AlignHorizontal_Mask |
QtCore.Qt.AlignVertical_Mask)))
and c++:
Q_ASSERT ( alignment == ( alignment & (
Qt::AlignHorizontal_Mask | Qt::AlignVertical_Mask ) ) );
the launchpad.net version would not accept
Qt.AlignLeft|Qt.AlignVCenter
the C++ version and mine do.
> > 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?
yes. And whitespace changes and some docstrings. Maybe
it is easier to look at my single commits for spotting relevant
differences.
> 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).
I have no idea. In Kajongg I have an editable treeview and
adding assert(self.model.parent(index) == parent)
passes (just tried). You'll have to ask the author
--
Wolfgang
_______________________________________________
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