Bug #7748
openWStringListModel does not support restoring of raw indexes.
0%
Description
Implementation of fromRawIndex/toRawIndex is missing in WStringListModel. This leads to unexpected and different results after sorting compared to e.g. WStandardItemModel.
`auto cb = std::make_uniqueWt::WComboBox();
// WComboBox has WStringListModel by default.
for (auto& t : { "c", "d", "b", "a" })
cb->addItem(t);
cb->setCurrentIndex(2);
auto text1 = cb->currentText(); // "b"
cb->model()->sort(0);
auto text2 = cb->currentText(); // "a"
assert(text1 == text2);
cb->setModel(std::make_sharedWt::WStandardItemModel());
for (auto& t : { "c", "d", "b", "a" })
cb->addItem(t);
cb->setCurrentIndex(2);
auto text3 = cb->currentText(); // "b"
cb->model()->sort(0);
auto text4 = cb->currentText(); // "b"
assert(text3 == text4);`
No data to display