diff options
author | Christian Ehrlicher <[email protected]> | 2025-07-02 21:23:30 +0200 |
---|---|---|
committer | Christian Ehrlicher <[email protected]> | 2025-07-08 01:37:28 +0200 |
commit | 50f1f0d092163e4cd0bb06b7f40daff7b7386437 (patch) | |
tree | 0b437b0d4bae1c96b1027ae1e9f6f871272f16f5 | |
parent | 1dbac99cebdb38cd82e72ba7282a18793cac2195 (diff) |
We need to set the mouse tracking on the viewport, not on the tableview
itself to get all hover events properly propagated to QTableView. For
QTree/QListView this is already done within QWindowsVistaStyle::polish()
This amends 85333b3d8cb89bf58c6c6c0db7c3db5c95b4cbfc.
Pick-to: 6.10 6.9 6.8
Fixes: QTBUG-129242
Fixes: QTBUG-137776
Change-Id: I938e62fbaff27a4b6c6587d182c1151792e225d9
Reviewed-by: Wladimir Leuschner <[email protected]>
-rw-r--r-- | src/plugins/styles/modernwindows/qwindows11style.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/styles/modernwindows/qwindows11style.cpp b/src/plugins/styles/modernwindows/qwindows11style.cpp index 82e978862f8..e2e4fce357e 100644 --- a/src/plugins/styles/modernwindows/qwindows11style.cpp +++ b/src/plugins/styles/modernwindows/qwindows11style.cpp @@ -2212,8 +2212,9 @@ 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 (qobject_cast<QTableView *>(widget)) - widget->setAttribute(Qt::WA_Hover, true); + // QTreeView & QListView are already set in the base windowsvista style + if (auto table = qobject_cast<QTableView *>(widget)) + table->viewport()->setAttribute(Qt::WA_Hover, true); } } |