[Qt-interest] Displaying NULL values using QDataWidgetMapper

saikari keitele saikari78 at gmail.com
Fri Jan 22 10:48:07 CET 2010


Sorry, I hadn't searched the list, although after reading the posts you
mention it is still unclear to me whether this is a bug and what the
solution to it is.
I'm sorry I don't know much Qt. Would the solution be to subclass
QSqlTableModel <http://doc.trolltech.com/4.4/qsqltablemodel.html> and to
redefine the data method?
Many thanks for any suggestions or tips.


On Fri, Jan 22, 2010 at 8:18 AM, Andre Somers <andre at familiesomers.nl>wrote:

> saikari keitele wrote:
> > Hello,
> >
> > I'm using a QDataWidgetMapper to display and edit the fields of a
> > database table.
> > I have mapped a lineEdit to an integer column in the table. When this
> > column has a null value in the database, it is displayed with the
> > value 0 in the lineEdit. However I would like it to be displayed as
> > the empty string so that the lineEdit appears blank when the value is
> > NULL. What is the simplest way of doing this?
> > Thank you very much for any help,
> >
> >
> > saikari keitele
> Did you search the list before asking this question?
> This very topic was discussed in two threads started by Bar Tomas. One
> started on the 19th, the other one on the 20th. of this month.
>
> André
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100122/20b50728/attachment.html 


More information about the Qt-interest-old mailing list