PDA

View Full Version : QdataWidgetmapper + Qcalenderwidget



Delphi
6th May 2013, 16:33
Hello,

Im using a Qdatawidgetmapper to map a datum field from my sql server database to a Qcalanderwidget. i use onfieldchange and autosubmit.

when load the form or change to an other row it works. the date changes.
But when i change the valuwe it is not committed the database.

i tryed:

connect(ui->QCalenderWidgetAfleverdatum, SIGNAL(selectionChanged()),mapper,SLOT(submit()));
but the it is submitting NULL to the database

Mapper->addMapping(ui->QCalenderWidgetAfleverdatum ,orderGegevens->record().indexOf("leverdatum"), "selectedDate");
i'm getting : QODBCResult::exec: unable to bind variable: "[Microsoft][ODBC SQL Server Driver]De optionele voorziening is niet geïmplementeerd"

How can i connect Qdatawidgetmapper to a calenderwiged and make ik work?

Santosh Reddy
10th May 2013, 15:54
connect(ui->QCalenderWidgetAfleverdatum, SIGNAL(selectionChanged()),mapper,SLOT(submit()));
but the it is submitting NULL to the database

Mapper->addMapping(ui->QCalenderWidgetAfleverdatum ,orderGegevens->record().indexOf("leverdatum"), "selectedDate");
i'm getting : QODBCResult::exec: unable to bind variable: "[Microsoft][ODBC SQL Server Driver]De optionele voorziening is niet geïmplementeerd"
I don't think it is a problem with QCalendarWidget/QDataWidgetMapper, it may be somthing to do with ODBC driver, check if removing the QCalendarWidget is submitting the other data properly.