Track Qt tab widget selection when adding pages to wxNotebook

Ensure the selected state tracks the Qt selection: without this, if
no explicit selection is made after adding the pages,
wxNotebook::GetSelection() returns wxNOT_FOUND even though the first
page is selected.

Closes https://github.com/wxWidgets/wxWidgets/pull/1182
This commit is contained in:
Graham Dawes
2019-01-25 16:33:58 +00:00
committed by Vadim Zeitlin
parent b1594725c9
commit 0265139c11

View File

@@ -154,6 +154,7 @@ 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)
{