From ff48e158ab78899a828645ed3500ef3461390c9f Mon Sep 17 00:00:00 2001 From: Sami Varanka Date: Wed, 30 Oct 2024 09:29:14 +0200 Subject: [PATCH] Take Header splitter cursor for QGraphicsProxyWidget Strangely when a QTreeview is put in GraphicsView using QGraphicsProxyWidget, QTreeView header splitter cursor does not appears though section can be resized without that. This change forces the QGraphicsProxyWidget to take header splitter cursor from lastwidget. Fixes: QTBUG-128912 Change-Id: I783e8357ae8386af70d28a1495e3b2367921df76 Reviewed-by: Eirik Aavitsland Reviewed-by: Volker Hilsheimer (cherry picked from commit 769392c3a8055af996f593dccd85ca3f775b1640) Reviewed-by: Qt Cherry-pick Bot --- src/widgets/graphicsview/qgraphicsproxywidget.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.cpp b/src/widgets/graphicsview/qgraphicsproxywidget.cpp index 1ff48141429..fbf66ea02fd 100644 --- a/src/widgets/graphicsview/qgraphicsproxywidget.cpp +++ b/src/widgets/graphicsview/qgraphicsproxywidget.cpp @@ -295,6 +295,15 @@ void QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent(QGraphicsSceneMouseEvent #endif } +#ifndef QT_NO_CURSOR + // Keep cursor in sync + if (lastWidgetUnderMouse) { + QCursor widgetsCursor = lastWidgetUnderMouse->cursor(); + if (q->cursor() != widgetsCursor) + q->setCursor(widgetsCursor); + } +#endif + event->setAccepted(mouseEvent.isAccepted()); }