Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.6.2
-
None
-
Gentoo Linux (stable), kernel 2.6.34, qt 4.6.2
Description
I fed a QComboBox instance with an instance of QSqlTableModel (setModel (...)) and select the column to be displayed (setModelColumn ()).
To get the items displayed in a way i also set the item delegate to a custom one (setItemDelegate ()).
The items in the drop-down list are displayed correctly, but the one displayed as selected not.
Digging a little bit in the qt-code (of version 4.6.2) i come to file qcombobox.cpp at line 1239ff which says:
------------------------ cut ---------------------
QString QComboBoxPrivate::itemText(const QModelIndex &index) const
{
return index.isValid() ? model->data(index, itemRole()).toString() : QString();
}
------------------------ cut ---------------------
I think it should call the method displayText(...) item delegate (if one is set) after obtaining the value to display. Something like:
return index.isValid() ? view->itemDelegate ()>displayText (model>data(index, itemRole())) : QString();