summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWladimir Leuschner <wladimir.leuschner@qt.io>2023-09-28 13:34:28 +0200
committerWladimir Leuschner <wladimir.leuschner@qt.io>2023-10-17 22:44:36 +0200
commit4f51742ee12bea211b2fd0abd50a700e69a9a95c (patch)
tree3c3addb960e34c3d281bc9c20fe8e164f7fbca33
parent9a64449cc353a35b37518ba4fcc62439877f6f10 (diff)
Prevent state change of selected LineEdit in QWindowsVistaStyle when hovering
Hovering over a selected LineEdit gives the selected state precedence over hover state. Fixes: QTBUG-117606 Pick-to: 6.5 6.6 Change-Id: Ia52ce94443100bf3fb5d83b8dffa2752818ca33d Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> Reviewed-by: Timothée Keller <timothee.keller@qt.io>
-rw-r--r--src/plugins/styles/windowsvista/qwindowsvistastyle.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp
index a800e6ba22..b01a7eda3c 100644
--- a/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp
+++ b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp
@@ -1442,17 +1442,17 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
theme = OpenThemeData(nullptr, L"Edit");
partId = EP_EDITBORDER_NOSCROLL;
- if (oldState & State_MouseOver)
+ if (oldState & State_HasFocus)
+ fromState = ETS_SELECTED;
+ else if (oldState & State_MouseOver)
fromState = ETS_HOT;
- else if (oldState & State_HasFocus)
- fromState = ETS_FOCUSED;
else
fromState = ETS_NORMAL;
- if (state & State_MouseOver)
+ if (state & State_HasFocus)
+ toState = ETS_SELECTED;
+ else if (state & State_MouseOver)
toState = ETS_HOT;
- else if (state & State_HasFocus)
- toState = ETS_FOCUSED;
else
toState = ETS_NORMAL;
@@ -1957,10 +1957,10 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
stateId = ETS_DISABLED;
else if (state & State_ReadOnly)
stateId = ETS_READONLY;
- else if (state & State_MouseOver)
- stateId = ETS_HOT;
else if (state & State_HasFocus)
stateId = ETS_SELECTED;
+ else if (state & State_MouseOver)
+ stateId = ETS_HOT;
QWindowsThemeData theme(widget, painter,
QWindowsVistaStylePrivate::EditTheme,
EP_EDITBORDER_NOSCROLL, stateId, option->rect);