diff --git a/autotests/parttest.cpp b/autotests/parttest.cpp index 6cc1e108c..6eddbd86c 100644 --- a/autotests/parttest.cpp +++ b/autotests/parttest.cpp @@ -316,10 +316,6 @@ void PartTest::testClickInternalLink() QTRY_COMPARE(part.m_document->currentPage(), 1u); // make sure cursor goes back to being an open hand again. Bug 421437 - // TODO: This test for bug 421437 has been committed when there was no fix for the bug - // available yet. That's why the QTRY_COMPARE_WITH_TIMEOUT is preceded by QEXPECT_FAIL. - // Please remove the QEXPECT_FAIL together with the fix for bug 421437. - QEXPECT_FAIL("", "Please remove this QEXPECT_FAIL once bug 421437 is fixed!", Continue); QTRY_COMPARE_WITH_TIMEOUT(part.m_pageView->cursor().shape(), Qt::OpenHandCursor, 1000); } diff --git a/ui/pageview.cpp b/ui/pageview.cpp index 4dda88a49..d7d0ee615 100644 --- a/ui/pageview.cpp +++ b/ui/pageview.cpp @@ -3171,8 +3171,6 @@ void PageView::wheelEvent(QWheelEvent *e) } } } - - updateCursor(); } bool PageView::viewportEvent(QEvent *e) @@ -3225,6 +3223,8 @@ void PageView::scrollContentsBy(int dx, int dy) for (const QRect &rect : rgn) viewport()->update(rect); + + updateCursor(); } // END widget events @@ -3895,12 +3895,15 @@ void PageView::updateCursor(const QPoint p) // detect the underlaying page (if present) PageViewItem *pageItem = pickItemOnPoint(p.x(), p.y()); + QScroller::State scrollerState = d->scroller->state(); if (d->annotator && d->annotator->active()) { if (pageItem || d->annotator->annotating()) setCursor(d->annotator->cursor()); else setCursor(Qt::ForbiddenCursor); + } else if (scrollerState == QScroller::Pressed || scrollerState == QScroller::Dragging) { + setCursor(Qt::ClosedHandCursor); } else if (pageItem) { double nX = pageItem->absToPageX(p.x()); double nY = pageItem->absToPageY(p.y());