From 35f212a788084e3ccc9445f6afda8fc7a46c0aec Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Fri, 4 Nov 2022 10:45:09 +0100 Subject: [PATCH] Fixed Qt6 build --- src/AutoHideDockContainer.cpp | 20 +++++++++++--------- src/AutoHideDockContainer.h | 3 +-- src/AutoHideTab.cpp | 33 +++++++++++++-------------------- src/AutoHideTab.h | 4 +--- 4 files changed, 26 insertions(+), 34 deletions(-) diff --git a/src/AutoHideDockContainer.cpp b/src/AutoHideDockContainer.cpp index 7dae896..f4deed3 100644 --- a/src/AutoHideDockContainer.cpp +++ b/src/AutoHideDockContainer.cpp @@ -573,18 +573,20 @@ void CAutoHideDockContainer::leaveEvent(QEvent *event) //============================================================================ -void CAutoHideDockContainer::enterEvent(QEvent *event) +bool CAutoHideDockContainer::event(QEvent* event) { - d->forwardEventToDockContainer(event); - Super::enterEvent(event); -} + switch (event->type()) + { + case QEvent::Enter: + case QEvent::Hide: + d->forwardEventToDockContainer(event); + break; + default: + break; + } -//============================================================================ -void CAutoHideDockContainer::hideEvent(QHideEvent *event) -{ - d->forwardEventToDockContainer(event); - Super::hideEvent(event); + return Super::event(event); } } diff --git a/src/AutoHideDockContainer.h b/src/AutoHideDockContainer.h index 7c222f4..0e1a3f6 100644 --- a/src/AutoHideDockContainer.h +++ b/src/AutoHideDockContainer.h @@ -64,8 +64,7 @@ protected: virtual bool eventFilter(QObject* watched, QEvent* event) override; virtual void resizeEvent(QResizeEvent* event) override; virtual void leaveEvent(QEvent *event) override; - virtual void enterEvent(QEvent *event) override; - virtual void hideEvent(QHideEvent *event) override; + virtual bool event(QEvent* event) override; /** diff --git a/src/AutoHideTab.cpp b/src/AutoHideTab.cpp index 5f69c45..38090ab 100644 --- a/src/AutoHideTab.cpp +++ b/src/AutoHideTab.cpp @@ -226,29 +226,22 @@ void CAutoHideTab::setDockWidget(CDockWidget* DockWidget) //============================================================================ -void CAutoHideTab::enterEvent(QEvent *event) +bool CAutoHideTab::event(QEvent* event) { - d->forwardEventToDockContainer(event); - Super::enterEvent(event); + switch (event->type()) + { + case QEvent::Enter: + case QEvent::Leave: + case QEvent::MouseButtonPress: + d->forwardEventToDockContainer(event); + break; + + default: + break; + } + return Super::event(event); } - -//============================================================================ -void CAutoHideTab::leaveEvent(QEvent *event) -{ - d->forwardEventToDockContainer(event); - Super::leaveEvent(event); -} - - -//============================================================================ -void CAutoHideTab::mousePressEvent(QMouseEvent* event) -{ - d->forwardEventToDockContainer(event); - Super::mousePressEvent(event); -} - - //============================================================================ bool CAutoHideTab::iconOnly() const { diff --git a/src/AutoHideTab.h b/src/AutoHideTab.h index 58ec665..fec49cd 100644 --- a/src/AutoHideTab.h +++ b/src/AutoHideTab.h @@ -68,9 +68,7 @@ protected: void setSideBar(CAutoHideSideBar *SideTabBar); void removeFromSideBar(); - virtual void enterEvent(QEvent *event) override; - virtual void leaveEvent(QEvent *event) override; - virtual void mousePressEvent(QMouseEvent* event) override; + virtual bool event(QEvent* event) override; public: using Super = CPushButton;