From e919ec6ccd628ca32427fd73b90e8e5e4f27853b Mon Sep 17 00:00:00 2001 From: ali kettab Date: Sun, 1 Oct 2023 14:06:14 +0100 Subject: [PATCH] Remove newly added functions from wxQt QtSet{Min,Max}Size() were added for use by Set{Min,Max}Size() and DoSetSizeHints() overrides. and since we have canceled overriding Set{Min,Max}Size() in previous commit, there is no need to keep them around without good reason. --- include/wx/qt/window.h | 5 ----- src/qt/toplevel.cpp | 19 ++++++++----------- src/qt/window.cpp | 24 ------------------------ 3 files changed, 8 insertions(+), 40 deletions(-) diff --git a/include/wx/qt/window.h b/include/wx/qt/window.h index ac2f4b36c5..17cc930fa9 100644 --- a/include/wx/qt/window.h +++ b/include/wx/qt/window.h @@ -225,11 +225,6 @@ protected: // itself. virtual QWidget* QtGetParentWidget() const { return GetHandle(); } - // wxTopLevelWindowQt::DoSetSizeHints() override calls these functions to - // set min/max size information at Qt level. - void QtSetMinSize(const wxSize& minSize); - void QtSetMaxSize(const wxSize& maxSize); - QWidget *m_qtWindow; private: diff --git a/src/qt/toplevel.cpp b/src/qt/toplevel.cpp index ab34b43198..2b3240d96b 100644 --- a/src/qt/toplevel.cpp +++ b/src/qt/toplevel.cpp @@ -246,21 +246,18 @@ long wxTopLevelWindowQt::GetWindowStyleFlag() const return winStyle; } -void wxTopLevelWindowQt::QtSetSizeIncrement(int width, int height) -{ - const int w = wxMax(0, width); - const int h = wxMax(0, height); - - GetHandle()->setSizeIncrement(w, h); -} - void wxTopLevelWindowQt::DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH) { - QtSetMinSize(wxSize(minW, minH)); - QtSetMaxSize(wxSize(maxW, maxH)); - QtSetSizeIncrement(incW, incH); + GetHandle()->setMinimumWidth(wxMax(0, minW)); + GetHandle()->setMinimumHeight(wxMax(0, minH)); + + GetHandle()->setMaximumWidth(wxMax(0, maxW)); + GetHandle()->setMaximumHeight(wxMax(0, maxH)); + + GetHandle()->setSizeIncrement(wxMax(0, incW), + wxMax(0, incH)); wxTopLevelWindowBase::DoSetSizeHints(minW, minH, maxW, maxH, incW, incH); } diff --git a/src/qt/window.cpp b/src/qt/window.cpp index b2aa89c66c..bb4b3f45bd 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -486,30 +486,6 @@ void wxWindowQt::SetFocus() GetHandle()->setFocus(); } -void wxWindowQt::QtSetMinSize(const wxSize& minSize) -{ - if ( !GetHandle() ) - return; - - if ( minSize.x >= 0 ) - GetHandle()->setMinimumWidth(minSize.x); - - if ( minSize.y >= 0 ) - GetHandle()->setMinimumHeight(minSize.y); -} - -void wxWindowQt::QtSetMaxSize(const wxSize& maxSize) -{ - if ( !GetHandle() ) - return; - - if ( maxSize.x >= 0 ) - GetHandle()->setMaximumWidth(maxSize.x); - - if ( maxSize.y >= 0 ) - GetHandle()->setMaximumHeight(maxSize.y); -} - /* static */ void wxWindowQt::QtReparent( QWidget *child, QWidget *parent ) { // Backup the attributes which will be changed during the reparenting: