Fix updating selection in wxNotebook::InsertPage() in wxQt

Just use DoSetSelectionAfterInsertion() provided by the base class,
which does the right thing already, including both setting m_selection
and sending (or not sending) the corresponding events.
This commit is contained in:
Vadim Zeitlin
2019-01-28 18:29:31 +01:00
parent 6fdcfd8199
commit da96ab179f

View File

@@ -154,12 +154,8 @@ bool wxNotebook::InsertPage(size_t n, wxWindow *page, const wxString& text,
// reenable firing qt signals as internal wx initialization was completed
m_qtTabWidget->blockSignals(false);
m_selection = m_qtTabWidget->currentIndex();
if (bSelect && GetPageCount() > 1)
{
SetSelection( n );
}
DoSetSelectionAfterInsertion(n, bSelect);
return true;
}