[PyKDE] Porting from PyQt3 to PyQt4
Andreas Pakulat
apaku at gmx.de
Thu May 11 17:13:13 BST 2006
On 11.05.06 17:48:16, Frode Øijord wrote:
> Andreas Pakulat wrote:
> >On 11.05.06 17:19:25, Frode Øijord wrote:
> >
> >>when porting from PyQt3 to PyQt4 will i have to rewrite all GUI code to the
> >>Qt4 way of doing things? More to the point, I have subclassed a QListView and
> >>a QListViewItem and I am wondering if I have to reimplement those with a
> >>model/view design?
> >>
> >
> >Well, if you don't want to do that, there's no real point in porting to
> >Qt4/PyQt4 anyway.
> >
> I really do want to rewrite these classes, but if they would work the way they
> are now, I would not have to rewrite all the code in one go, which would make
> things much easier. QListWidget and QListWidgetItem looks like QListView and
> QListViewItem in Qt3, perhaps i could use those as an intermediate step? That
> would help...
Well, you'll still have quite some work to do.
I'd like to add that moving from QListView to a model/view is not that
hard at all, once you understood the model/view way. Actually I ported
an application (that I did not write myself, i.e. I had little idea of
the code) to Qt4 and replaced all QListViews (which where used heavily)
with model/views. I could reuse quite some parts of the code in the
model, i.e. all code that extracts information from the underlying
data structures.
Also you might not even need to write your own view, the Qt classes can
already do a lot.
Andreas
--
The whole world is a tuxedo and you are a pair of brown shoes.
-- George Gobel
More information about the PyQt
mailing list