[PyKDE] [PyQt3] problem using a custom QSqlCursor on a QDataTable

Hans-Peter Jansen hpj at urpla.net
Sun Oct 8 17:47:29 BST 2006


Am Sonntag, 8. Oktober 2006 17:26 schrieb Phil Thompson:
> On Saturday 07 October 2006 12:13 pm, Hans-Peter Jansen wrote:
> > Hi Phil,
> >
> > here's is a nasty problem with using a custom QSqlCursor on a
> > QDataTable, I didn't found a workaround yet (other than avoiding
> > this all together, which isn't a feasible option here):
> >
> > Whenever the update() and delRecords() methods on the parent class
> > are called, they show recursive behavior, just like (wrongly)
> > calling self.update(invalidate) in the custom QSqlCursor class.
> >
> > Another aspect on this problem is, that QDataTable insists on a 3
> > arg signature when calling sqlCursor().update(), but the base class
> > must be called with the 2 arg variant.
> >
>
> Your update() will be called for both of the C++ signatures. Your
> code doesn't seem to be doing enough parsing of the argument types to
> work out which one it is.

Stupid me. Thanks for the hint. Next time, I hopefully remember this!

For the sake of completeness, I've attached the corrected script..

Bye,
    Pete

-------------- next part --------------
A non-text attachment was scrubbed...
Name: qdatatablewithsqlcursorsubclass.py
Type: application/x-python
Size: 3235 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20061008/469ec83d/qdatatablewithsqlcursorsubclass.bin


More information about the PyQt mailing list