Reset selection in after deleting selected item from wxChoice

This commit is contained in:
Richard Smith
2019-01-17 12:00:01 +00:00
committed by Vadim Zeitlin
parent cfdf80d586
commit f2538a0bc4

View File

@@ -240,6 +240,12 @@ void wxChoice::DoClear()
void wxChoice::DoDeleteOneItem(unsigned int pos)
{
const int selection = GetSelection();
if ( selection >= 0 && static_cast<unsigned int>(selection) == pos )
{
SetSelection( wxNOT_FOUND );
}
m_qtComboBox->removeItem(pos);
}