[Qt-interest] QSqlRelationalDelegate and QDataWidgetMapper
Christian Gagneraud
cgagneraud at techworks.ie
Tue Feb 9 00:04:57 CET 2010
On 02/08/2010 09:26 PM, Christian Gagneraud wrote:
> Hi There,
>
> I'm using a QTableView with a QSqlRelationalTableModel and a
> QSqlRelationalDelegate, this works great.
> In another QDialog, I'm using as well a QDataWidgetMapper, and it
> doesn't seems to work when there is a relation set-up in the model (I
> got an empty field)
> I tried to use on my form a QLineEdit or a QComboBox, I tried to
> set-up the item delegate of the mapper as well with a
> QSqlRelationalDelegate but none of these have worked so far.
>
> Is the QSqlRelationalDelegate supposed to work seamlessly with a
> QTableView and QDataWidgetMapper? Or is it me that do something wrong?
OK, I've found my error:
After a relation is set via setRelation(), the column is rename
according to the "mappedtablename_displayedcolumnname"...and I was
still using the original column name to set up my QDataWidgetMapper,
that's why it didn't work....
But that's not all! It's still doesn't work with a combo box!
If I use a QLineEdit, then I get the right value. But I would like to
have the same QComboBox as in the TableView...
Chris
>
> Any help or point-out appreciated.
>
> Regards,
> Chris
> _______________________________________________
> 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