From e21c3025668186edb4573b3335d679588c1a42e8 Mon Sep 17 00:00:00 2001
From: Ivan Ugryumov <smille2003@yandex.ru>
Date: Thu, 5 Dec 2024 20:03:54 +0300
Subject: [PATCH] Fix: tab bar scroll for mouse

---
 src/DockAreaTabBar.cpp | 6 ++++++
 src/DockAreaTabBar.h   | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/src/DockAreaTabBar.cpp b/src/DockAreaTabBar.cpp
index d0adaac..724aedc 100644
--- a/src/DockAreaTabBar.cpp
+++ b/src/DockAreaTabBar.cpp
@@ -157,6 +157,12 @@ CDockAreaTabBar::~CDockAreaTabBar()
 }
 
 
+//============================================================================
+void CDockAreaTabBar::wheelEvent(QWheelEvent* Event)
+{
+    QCoreApplication::sendEvent(horizontalScrollBar(), Event);
+}
+
 //============================================================================
 void CDockAreaTabBar::setCurrentIndex(int index)
 {
diff --git a/src/DockAreaTabBar.h b/src/DockAreaTabBar.h
index e4b94f1..60557fe 100644
--- a/src/DockAreaTabBar.h
+++ b/src/DockAreaTabBar.h
@@ -64,6 +64,9 @@ private Q_SLOTS:
 	void onCloseOtherTabsRequested();
 	void onTabWidgetMoved(const QPoint& GlobalPos);
 
+protected:
+    virtual void wheelEvent(QWheelEvent* Event) override;
+
 public:
 	using Super = QScrollArea;