From 5ff8c2eb00aedc3fec76fe63e4914a6b4e5f32bd Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Wed, 1 Jan 2025 11:50:49 +0100 Subject: [PATCH] Windows11Style: enable mouse tracking for QTableView Mouse tracking is needed for windows 11 style since it is using QStyle::State_MouseOver to draw the cells. Pick-to: 6.8 Fixes: QTBUG-129242 Change-Id: Ib79ac5a8c14ac8c70365e87120f80b4e4ee4c5b9 Reviewed-by: Volker Hilsheimer Reviewed-by: Oliver Wolff (cherry picked from commit 85333b3d8cb89bf58c6c6c0db7c3db5c95b4cbfc) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/styles/modernwindows/qwindows11style.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/styles/modernwindows/qwindows11style.cpp b/src/plugins/styles/modernwindows/qwindows11style.cpp index 393ef765edd..54f56cf2028 100644 --- a/src/plugins/styles/modernwindows/qwindows11style.cpp +++ b/src/plugins/styles/modernwindows/qwindows11style.cpp @@ -2191,6 +2191,8 @@ void QWindows11Style::polish(QWidget* widget) pal.setColor(scrollarea->viewport()->backgroundRole(), Qt::transparent); scrollarea->viewport()->setPalette(pal); scrollarea->viewport()->setProperty("_q_original_background_palette", originalPalette); + if (const auto tableView = qobject_cast(widget)) + widget->setAttribute(Qt::WA_Hover, true); } }