Fixed issue #654 - Wheel event on DockAreaTabBar

This commit is contained in:
Uwe Kindler 2024-07-25 08:42:30 +02:00
parent 04f6d9168e
commit 5edbcc1970
4 changed files with 22 additions and 1 deletions

View File

@ -473,6 +473,15 @@ bool CDockAreaTabBar::eventFilter(QObject *watched, QEvent *event)
updateGeometry(); updateGeometry();
break; break;
// Manage wheel event
case QEvent::Wheel:
// Ignore wheel events if tab is currently dragged
if (Tab->dragState() == DraggingInactive)
{
wheelEvent((QWheelEvent* )event);
}
break;
default: default:
break; break;
} }

View File

@ -34,7 +34,6 @@
#include <QStackedLayout> #include <QStackedLayout>
#include <QScrollBar> #include <QScrollBar>
#include <QWheelEvent>
#include <QStyle> #include <QStyle>
#include <QPushButton> #include <QPushButton>
#include <QDebug> #include <QDebug>

View File

@ -789,6 +789,13 @@ bool CDockWidgetTab::event(QEvent *e)
} }
//============================================================================
eDragState CDockWidgetTab::dragState() const
{
return d->DragState;
}
//============================================================================ //============================================================================
void CDockWidgetTab::onDockWidgetFeaturesChanged() void CDockWidgetTab::onDockWidgetFeaturesChanged()
{ {

View File

@ -178,6 +178,12 @@ public:
*/ */
void setIconSize(const QSize& Size); void setIconSize(const QSize& Size);
/**
* Returns the current drag state of this tab.
* Use this function to determine if the tab is currently being dragged
*/
eDragState dragState() const;
public Q_SLOTS: public Q_SLOTS:
virtual void setVisible(bool visible) override; virtual void setVisible(bool visible) override;