┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMéven Car <[email protected]>2026-05-10 11:24:32 +0200
committerMéven Car <[email protected]>2026-05-10 19:25:26 +0200
commit98c7ec7e20cfec6b4b55eaf3f06e3350710aab2d (patch)
treee0c580c69c472a28777eede534fce575d37c1578
parentd052906e2d3d865fca242ce3fff7cefb779f0845 (diff)
dolphintabbar: remove tabClosedRequested handling for middle click
Qt 6.11 added its own middle click tab closing.
-rw-r--r--src/dolphintabbar.cpp4
-rw-r--r--src/dolphintabbar.h11
2 files changed, 11 insertions, 4 deletions
diff --git a/src/dolphintabbar.cpp b/src/dolphintabbar.cpp
index 1b8236abb..85cfa0788 100644
--- a/src/dolphintabbar.cpp
+++ b/src/dolphintabbar.cpp
@@ -39,7 +39,6 @@ protected:
DolphinTabBar::DolphinTabBar(QWidget *parent)
: QTabBar(parent)
, m_autoActivationIndex(-1)
- , m_tabToBeClosedOnMiddleMouseButtonRelease(-1)
{
setAcceptDrops(true);
setSelectionBehaviorOnRemove(QTabBar::SelectPreviousTab);
@@ -131,6 +130,8 @@ void DolphinTabBar::dropEvent(QDropEvent *event)
QTabBar::dropEvent(event);
}
+// Qt 6.11 added its own middle click tab closing
+#if QT_VERSION < QT_VERSION_CHECK(6, 11, 0)
void DolphinTabBar::mousePressEvent(QMouseEvent *event)
{
const int index = tabAt(event->pos());
@@ -155,6 +156,7 @@ void DolphinTabBar::mouseReleaseEvent(QMouseEvent *event)
QTabBar::mouseReleaseEvent(event);
}
+#endif
void DolphinTabBar::mouseDoubleClickEvent(QMouseEvent *event)
{
diff --git a/src/dolphintabbar.h b/src/dolphintabbar.h
index 54eeea774..1bc8c6ff2 100644
--- a/src/dolphintabbar.h
+++ b/src/dolphintabbar.h
@@ -30,10 +30,13 @@ protected:
void dragLeaveEvent(QDragLeaveEvent *event) override;
void dragMoveEvent(QDragMoveEvent *event) override;
void dropEvent(QDropEvent *event) override;
- void mousePressEvent(QMouseEvent *event) override;
- void mouseReleaseEvent(QMouseEvent *event) override;
void mouseDoubleClickEvent(QMouseEvent *event) override;
+#if QT_VERSION < QT_VERSION_CHECK(6, 11, 0)
+ void mouseReleaseEvent(QMouseEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
+#endif
+
/**
* Opens a context menu for the tab on the \a event position.
*/
@@ -53,7 +56,9 @@ private:
private:
QTimer *m_autoActivationTimer;
int m_autoActivationIndex;
- int m_tabToBeClosedOnMiddleMouseButtonRelease;
+#if QT_VERSION < QT_VERSION_CHECK(6, 11, 0)
+ int m_tabToBeClosedOnMiddleMouseButtonRelease = -1;
+#endif
};
#endif // DOLPHIN_TAB_BAR_H