[PyKDE] Model-View application: view not updated

Andreas Pakulat apaku at gmx.de
Sat Dec 16 18:45:36 GMT 2006


On 16.12.06 14:19:00, Sibylle Koczian wrote:
> "Andreas Pakulat" <apaku at gmx.de> schrieb:
> > On 15.12.06 16:17:21, Sibylle Koczian wrote:
> > > The problem is with the cancel button: the changed records are only
> > > changed back after the window lost focus - the view isn't updated
> > > directly after clicking the button. It _is_ updated after changing the
> > > spin box value - but only if it's a real change, not after changing and
> > > changing back again to the old value. I can't understand this, because
> > > in both cases the same method is called.
> > 
> > Hmm, I don't think I follow your description. 
> 
> I'll try again. The application is started and shows some records in a QTableView. I edit one or more of these records and decide to cancel my alterations. So I click on "cancel". No change in the view. Now I can do several things to get back the unedited records:

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)

If you can't change your Qt version, try emitting the dataChanged
Signal with the top-left and bottom-right QModelIndex.

> BTW: Did you look at the
> > ready-made models for accessing SQL databases in Qt4?
> 
> I didn't understand how to get the SQL support for Firebird.

Load the driver? I haven't compiled firebird support here, but it should
be as easy as that.

> 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)

Andreas

-- 
Is this really happening?




More information about the PyQt mailing list