[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyKDE] Using QSqlQuery + bindValue = TypeError ?
From: Hans-Peter Jansen <hpj () urpla ! net>
Date: 2005-02-27 15:21:09
Message-ID: 200502271621.09137.hpj () urpla ! net
[Download RAW message or body]
On Sunday 27 February 2005 15:27, Phil Thompson wrote:
> 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.
Well, I can imagine that.
Btw: such problems also occur, when Qt wants a QBrush, and you want to
give it a color, e.g.:
def paintEvent(self, e):
p = QPainter(self)
p.fillRect(self.rect(), QBrush(Qt.black))
Qt seems to be able to cast a QColor to a QBrush in this case..
Maybe these cases deserve a little chapter for their own in the docs
and an item in the sip wishlist.
Pete
_______________________________________________
PyKDE mailing list PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic