It depends on what your model has as the data for the cell which is represented by the combobox.
If the data for this cell is an zero-based integer, then you can most likely map that directly into the combobox' currentIndex.
Lets assume you have three values: "A", "B", "C", and the model associates the numbers 0, 1 and 2 respectively.
combo->addItem("A");
combo->addItem("B");
combo->addItem("C");
dataWidgetMapper->addMapping(combo, columnInTheModel, "currentIndex");
QComboBox *combo = new QComboBox;
combo->addItem("A");
combo->addItem("B");
combo->addItem("C");
dataWidgetMapper->addMapping(combo, columnInTheModel, "currentIndex");
To copy to clipboard, switch view to plain text mode
Cheers,
_
Bookmarks