Skip to content

Commit

Permalink
Fixed issue #654 - Wheel event on DockAreaTabBar
Browse files Browse the repository at this point in the history
  • Loading branch information
githubuser0xFFFF committed Jul 25, 2024
1 parent 04f6d91 commit 5edbcc1
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/DockAreaTabBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,15 @@ bool CDockAreaTabBar::eventFilter(QObject *watched, QEvent *event)
updateGeometry();
break;

// Manage wheel event
case QEvent::Wheel:
// Ignore wheel events if tab is currently dragged
if (Tab->dragState() == DraggingInactive)
{
wheelEvent((QWheelEvent* )event);
}
break;

default:
break;
}
Expand Down
1 change: 0 additions & 1 deletion src/DockAreaWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

#include <QStackedLayout>
#include <QScrollBar>
#include <QWheelEvent>
#include <QStyle>
#include <QPushButton>
#include <QDebug>
Expand Down
7 changes: 7 additions & 0 deletions src/DockWidgetTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,13 @@ bool CDockWidgetTab::event(QEvent *e)
}


//============================================================================
eDragState CDockWidgetTab::dragState() const
{
return d->DragState;
}


//============================================================================
void CDockWidgetTab::onDockWidgetFeaturesChanged()
{
Expand Down
6 changes: 6 additions & 0 deletions src/DockWidgetTab.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ private Q_SLOTS:
*/
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:
virtual void setVisible(bool visible) override;

Expand Down

0 comments on commit 5edbcc1

Please sign in to comment.