From f2538a0bc423886f6d838cb112af038366fe915e Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 17 Jan 2019 12:00:01 +0000 Subject: [PATCH] Reset selection in after deleting selected item from wxChoice --- src/qt/choice.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qt/choice.cpp b/src/qt/choice.cpp index 4bc672b71e..20c9dac7fb 100644 --- a/src/qt/choice.cpp +++ b/src/qt/choice.cpp @@ -240,6 +240,12 @@ void wxChoice::DoClear() void wxChoice::DoDeleteOneItem(unsigned int pos) { + const int selection = GetSelection(); + + if ( selection >= 0 && static_cast(selection) == pos ) + { + SetSelection( wxNOT_FOUND ); + } m_qtComboBox->removeItem(pos); }