Does qdatawidgetmapper update databases?
I used the code that can be found at the link below and modified it just to connect to my database(all i did was change "bool createConnections"; nothing else).
http://www.trolltech.com/developer/t...ntry&id=147264
I ran the code and got it to work. I changed
#if 1
#else
#endif
#if 1
model->setEditStrategy(QSqlTableModel::OnFieldChange);
#else
model->setEditStrategy(QSqlTableModel::OnManualSubmit);
#endif
To copy to clipboard, switch view to plain text mode
to
#if 0 //changed 1 to 0;thats all
#else
#endif
#if 0 //changed 1 to 0;thats all
model->setEditStrategy(QSqlTableModel::OnFieldChange);
#else
model->setEditStrategy(QSqlTableModel::OnManualSubmit);
#endif
To copy to clipboard, switch view to plain text mode
and the view was updated perfectly; using the mapped lineEdit . But when i go back to the command prompt and check the database, nothing has changed.
Can someone tell me how to update the database using the mapped widget?
My code follows the exact same procedure as that in the link, with only some formatting differences. My mapped widgets does not update the database, the ones in the code at the above URL does not update the database either.
Bookmarks