From d4b40fa96bcb83eb8948c381bdae9c1ed0f223d0 Mon Sep 17 00:00:00 2001 From: Axel Spoerl Date: Tue, 18 Apr 2023 10:02:33 +0200 Subject: QTabBar: draw text within moving tab When a tab was moved by dragging, the tab's rectangle was drawn empty, without the tab text. When a tab was moved by animated snap back to its original position, the tab text was already drawn on the original position, while the rectangle was still moving due to animation. Adds the enum value QStyleOptionTab::TabPosition::Moving When this option is set, QCommonStyle draws the tab text at the current position instead of the original home position of the tab. The QMacStyle switches over the TabPosition enum. As a moving tab is laid out like the last tab in the given orientation, the enum value Moving is treated like End. Fixes: QTBUG-112277 Change-Id: I42a2d9c269dadfe9819c12dbc69e3ae995a45b09 Reviewed-by: Volker Hilsheimer --- src/widgets/styles/qstyleoption.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/widgets/styles/qstyleoption.cpp') diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp index de7cd482a3..73164918bb 100644 --- a/src/widgets/styles/qstyleoption.cpp +++ b/src/widgets/styles/qstyleoption.cpp @@ -1314,6 +1314,8 @@ QStyleOptionTab::QStyleOptionTab(int version) \value Middle The tab is neither the first nor the last tab in the tab bar. \value End The tab is the last tab in the tab bar. \value OnlyOneTab The tab is both the first and the last tab in the tab bar. + \value Moving The tab is moving by mouse drag or animation. + This enum value was added in Qt 6.6. \sa position */ -- cgit v1.2.3