[PyKDE] Model-View application: view not updated

Andreas Pakulat apaku at gmx.de
Sun Dec 17 18:33:26 GMT 2006

On 17.12.06 13:22:22, Sibylle Koczian wrote:
> Am Samstag, den 16.12.2006, 19:45 +0100 schrieb Andreas Pakulat:
> > Ok, thanks now I do understand your problem. Unfortunately I can't
> > reproduce it here with your example application. After editing two cells
> > and clicking Cancel the view is updated to reflect the original data and
> > I get 
> > 
> > TestModel.setResultset called
> > fillTable called
> > TestModel.setResultset called
> > Signal modelReset empfangen
> > 
> > In the console, so its clearly working. What version of Qt4 are you
> > using? (I'm on 4.2.x here, where x is IIRC something around 2)
> > 
> Qt4: 4.2.0-1ubuntu6 (installed packages: libqt4-core, -def, -gui,
> -qt3support, -sql, qt4-designer, qt4-doc - possibly something lacking?)

No, but...

> PyQt4: 4.0.1-1ubuntu1 (installed packages: pyqt4-dev-tools, python-qt4,
> -qt4-dev, -doc, -sql)

You should update that. PyQt4 4.0.1 doesn't have support for Qt4.2
Actually I'm surprised they got it to build with Qt4.2, IIRC the changes
needed are only included in PyQt4 4.1. Thats one of the reasons I roll
my own Python/Qt4/PyQt4 into $HOME here...

> > If you can't change your Qt version, try emitting the dataChanged
> > Signal with the top-left and bottom-right QModelIndex.
> That has helped: I replaced the "self.reset()" at the end of
> setResultset() with the dataChanged Signal, now I get the original data
> back without changing focus or doing other tricks. It's not very
> beautiful, but it works for the moment.

This would imply that it could be a problem in Qt4.2.0 itself. Maybe you
know enough C++ to re-write your example in it, just for testing of
course. It seems its fixed in later Qt4.2 versions...

> > > Especially using Ubuntu which doesn't put Firebird in the standard place Qt4 expects it in.
> > 
> > Well, if firebird libs and includes are in different directories use the
> > -I and -L flags to Qt4's configure (or use the system-provided Qt4 if it
> > includes firebird support - which it should). For example I run
> > configure -I/usr/include/mysql -I/usr/include/postgresql
> > to get the mysql and postgresql driver built (am using plain Debian
> > here)
> The system provided Qt4 doesn't include Firebird support, as far as I
> can see (Synaptic says "PostgreSQL, MySQL, SQLite"). Qt4's configure:
> that would be the configure step as in "configure / make / make
> install", right?

Correct, I thought you roll your own Qt4 from source...


You have a strong appeal for members of your own sex.

More information about the PyQt mailing list