|
|
On torsdag den 13. December 2007, Anders Larsen wrote:
> Stephen Collyer wrote:
> > Is there a reason for the lack of such a method in QSqlQuery ?
> > I note that it exists in QSqlRecord and it would seem to be
> > an obvious candidate for QSqlQuery too.
>
> My guess is that it was left out because it's just a convenience
> function that isn't really required, that the index based lookup is
> faster, and that no-one asked for it.
>
> Subclassing QSqlQuery is a bit of overkill. You can simply use
> QSqlRecord::value(QString&) instead: query.record().value(fieldName).
>
> ... but if you prefer to see it in the QSqlQuery API you can submit a
> feature suggestion of course :-)
I bet you trolls would reject such a feature. You wouldn't add a method
that "improve" this:
query.record().value(fieldName);
to this:
query.value(fieldName)
Just imagine the explosion in methods we would have to consider, if this was
The Way of the Trolls (TM).
Adding convenience functions is not without cost. It makes the interface
larger, which makes it harder for everyone to find the methods they need, and
there is a cost in code size on runtime.
I for one hail our troll overlords. (*)
Bo.
(*) Quote (well, almost) Kent Brockmann.
--
Thorsen Consulting ApS - Qt consulting services
http://www.thorsen-consulting.dk
--
To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/
|
|