summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-03-20 15:39:55 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-03-28 15:47:44 +0000
commit1e393e82c905160ffabd98282aaa8901397ece2b (patch)
tree9de4a87a69feb4fef851dd7e58c06d5a434a017e /src
parent454de94787a4f0b54f2a629042b9aa73ed013026 (diff)
Guard QTabBar against nested event processing during moving tabs
If moving tabs results in nested event processing by the user's code in response to the tab index changing, the mouse release event might have been processed already, and the pressed index is reset back to -1. Fixes: QTBUG-74478 Change-Id: I9696b10a6218456ab381ffe3a65ea471cfa42413 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 6736118b8c1d9ca1517f0539bd93acc6f99732c1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/widgets/qtabbar.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp
index 61f89a6eb3..1b8b35d79c 100644
--- a/src/widgets/widgets/qtabbar.cpp
+++ b/src/widgets/widgets/qtabbar.cpp
@@ -2229,7 +2229,8 @@ void QTabBar::mouseMoveEvent(QMouseEvent *event)
}
}
// Buttons needs to follow the dragged tab
- d->layoutTab(d->pressedIndex);
+ if (d->pressedIndex != -1)
+ d->layoutTab(d->pressedIndex);
update();
}