Implement wxNotebook::DeleteAllPages() for wxQt

See https://github.com/wxWidgets/wxWidgets/pull/1191
This commit is contained in:
Graham Dawes 2019-01-28 16:52:07 +00:00 committed by Vadim Zeitlin
parent 6b11c372a1
commit 3cb395a5a5
2 changed files with 13 additions and 0 deletions

View File

@ -45,6 +45,8 @@ public:
int SetSelection(size_t nPage) { return DoSetSelection(nPage, SetSelection_SendEvent); }
int ChangeSelection(size_t nPage) { return DoSetSelection(nPage); }
virtual bool DeleteAllPages() wxOVERRIDE;
virtual QWidget *GetHandle() const;
protected:

View File

@ -169,6 +169,17 @@ wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const
return sizePage;
}
bool wxNotebook::DeleteAllPages()
{
if ( !wxNotebookBase::DeleteAllPages() )
return false;
m_qtTabWidget->blockSignals(true);
m_qtTabWidget->clear();
m_qtTabWidget->blockSignals(false);
return true;
}
int wxNotebook::DoSetSelection(size_t page, int flags)
{
wxCHECK_MSG(page < GetPageCount(), wxNOT_FOUND, "invalid notebook index");