[PyKDE] Using QSqlQuery + bindValue = TypeError ?

Phil Thompson phil at riverbankcomputing.co.uk
Sun Feb 27 14:27:45 GMT 2005


On Sunday 27 February 2005 2:08 pm, Hans-Peter Jansen wrote:
> On Sunday 27 February 2005 14:37, Jorge Godoy wrote:
> > But I keep always getting the following error message:
> >
> >     query.bindValue(":senha", senhaNova)
> > TypeError: argument 2 of QSqlQuery.bindValue() has an invalid type
>
> Try:
>     query.bindValue(":senha", QVariant(senhaNova))
>
> Phil, Qt is able to cast such stuff automatically, IIRC. Why can't
> PyQt do this for us, too?

It could be implemented, but I don't think the benefits outweigh the added 
complexity.

Phil




More information about the PyQt mailing list