From 88a62b3b910d09324dbbef3e1e791659ecd6537f Mon Sep 17 00:00:00 2001 From: Karol Polak Date: Tue, 4 Apr 2017 00:44:35 +0200 Subject: QQuickScrollBar: set implicit Cursor as Qt::ArrowCursor Scrollbar over TextArea had Qt::IBeamCursor, although the textarea would not be activated when clicked. Task-number: QTBUG-59629 Change-Id: Ie96ba03360fcfb5872f5bb6345e168c987978aca Reviewed-by: J-P Nurmi --- src/quicktemplates2/qquickscrollbar.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/quicktemplates2/qquickscrollbar.cpp') diff --git a/src/quicktemplates2/qquickscrollbar.cpp b/src/quicktemplates2/qquickscrollbar.cpp index 3dcb720a..8f4337ae 100644 --- a/src/quicktemplates2/qquickscrollbar.cpp +++ b/src/quicktemplates2/qquickscrollbar.cpp @@ -274,6 +274,9 @@ QQuickScrollBar::QQuickScrollBar(QQuickItem *parent) { setKeepMouseGrab(true); setAcceptedMouseButtons(Qt::LeftButton); +#if QT_CONFIG(cursor) + setCursor(Qt::ArrowCursor); +#endif } QQuickScrollBarAttached *QQuickScrollBar::qmlAttachedProperties(QObject *object) -- cgit v1.2.3 From ed64115cbf11a758a9cacd2bd34f3af5603f73b7 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 4 Apr 2017 16:18:39 +0200 Subject: Set explicit cursors on all interactive controls For example, if you have a floating button on top of a text editor, hovering the button must change the cursor from the editor's ibeam cursor to an arrow cursor. This applies to all interactive controls that call setAcceptedMouseButtons(). If a control blocks mouse events, it should not use some random cursor from another control underneath. Task-number: QTBUG-59629 Change-Id: I8a6ae306bbc76a9b22377361cb19cf9c3a872d31 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickscrollbar.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/quicktemplates2/qquickscrollbar.cpp') diff --git a/src/quicktemplates2/qquickscrollbar.cpp b/src/quicktemplates2/qquickscrollbar.cpp index 8f4337ae..cb5c0001 100644 --- a/src/quicktemplates2/qquickscrollbar.cpp +++ b/src/quicktemplates2/qquickscrollbar.cpp @@ -196,9 +196,18 @@ void QQuickScrollBarPrivate::setInteractive(bool enabled) return; interactive = enabled; - q->setAcceptedMouseButtons(interactive ? Qt::LeftButton : Qt::NoButton); - if (!interactive) + if (interactive) { + q->setAcceptedMouseButtons(Qt::LeftButton); +#if QT_CONFIG(cursor) + q->setCursor(Qt::ArrowCursor); +#endif + } else { + q->setAcceptedMouseButtons(Qt::NoButton); +#if QT_CONFIG(cursor) + q->unsetCursor(); +#endif q->ungrabMouse(); + } emit q->interactiveChanged(); } -- cgit v1.2.3