From 0265139c112e1696a54d63d5c1a1f692898909c1 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Fri, 25 Jan 2019 16:33:58 +0000 Subject: [PATCH] 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 --- src/qt/notebook.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qt/notebook.cpp b/src/qt/notebook.cpp index 4f00fa31f1..27d4ce7387 100644 --- a/src/qt/notebook.cpp +++ b/src/qt/notebook.cpp @@ -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) {