Ensure items are sorted when added to wxChoice in wxQt
Call sort() to resort the model after inserting a new item. Closes https://github.com/wxWidgets/wxWidgets/pull/1054
This commit is contained in:
parent
5189781072
commit
89e4ee1ec0
@ -148,6 +148,10 @@ int wxChoice::DoInsertItems(const wxArrayStringsAdapter & items,
|
||||
int wxChoice::DoInsertOneItem(const wxString& item, unsigned int pos)
|
||||
{
|
||||
m_qtComboBox->insertItem(pos, wxQtConvertString(item));
|
||||
|
||||
if ( IsSorted() )
|
||||
m_qtComboBox->model()->sort(0);
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user