[Qt-interest] QLineEdit QDataWidgetMapper SQL NULL

Jorge Abrines curruscataphractus at gmail.com
Fri Feb 13 12:53:57 CET 2009


Hi Miguel Angel,

Would you mind sending some snippets? I'm experiencing same difficulties
with NULL values, QLineEdits and QDataWidgetMapper.

Thanks in advance.

Best regards,

Jorge

Linos wrote:
> Don't worry i have created a QLineEdit subclass with a property SQLText that i 
> have used in the addMapping method of the QDataWidgetMapper.
> 
> Regards,
> Miguel Angel.
> 
> Linos escribió:
>> Hello,
>> 	i am using QDataWidgetMapper with a QSqlRelationalModel, the problem i have 
>> exactly it is that i am using QLineEdit with a column (alternative barcode for 
>> items), that usually is null but when it is set is UNIQUE, the standard behavior 
>> of QDataWidgetMapper for empty QLineEdit is to set the column on the model with 
>> an empty QString, so i load a item without alternative barcode (NULL value) and 
>> without make any change call submit in the widgetmapper and i get a empty string 
>> in the column and after edit a second item i have a unique error from 
>> Postgresql. What would be the better way to change this? Thanks.
>>
>> Regards,
>> Miguel Angel.
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 



More information about the Qt-interest-old mailing list