[PyKDE] qsqlcursor lifetime for qdatatable

Hans-Peter Jansen hpj at urpla.net
Tue Jun 25 23:29:00 BST 2002


On Tue, 25 Jun 2002 11:41:14 -0700
"Andreas Kloeckner" <kloeckner at rtna.daimlerchrysler.com> wrote:

> hi all,
> 
>   i just discovered another problem in pyqt, or rather in the
>   cooperation of qt's and pyqt's interface. the qsqlcursor that
>   you pass on to qdatatable's constructor is supposed to be available 
>   throughout the whole lifetime of the qdatatable. if you just create
>   a qsqlcursor locally and pass it to the constructor, you'll soon run
>   into a segfault because the garbage collector has gotten rid of
>   it.

Confirmed.
 
>   i propose that we redefine the semantics of qdatatable in such a way
>   that the table always takes posession of its cursor and frees it
>   itself. (possible by means of setCursor with the autoDelete parameter)
>   i would be willing to provide a patch for this, if there is
>   any demand.

I'm interested. Would be the first step in providing designer's database
support, too. I sent a patch for pyuic to generate correct QDataBrowser
code. But it's not enough, at least if one uses the c++ project wizard, 
because the action based signal handling seems to rule out the database
signals & slots definitions. <duh> And Trolltech seems not even interested
in bug reports, if you haven't paid for it :-( Don't know, if it makes any
difference, if you have...

>   i have one more question: how can you avoid the lengthy (~1.5 h)
>   complete recompile if you just make *one* change to *one* .sip file?
>   "make" doesn't do the trick for me, it just does nothing.
>
> andreas

Hans-Peter




More information about the PyQt mailing list