[okular] [Bug 421159] Scrolling by clicking the scroll bar is reset by scrolling with scroll wheel

Albert Astals Cid bugzilla_noreply at kde.org
Wed Jun 3 22:57:42 BST 2020


https://bugs.kde.org/show_bug.cgi?id=421159

--- Comment #11 from Albert Astals Cid <aacid at kde.org> ---
This makes the pageview scroll

void PartTest::testWheelInPageView()
{
    QVariantList dummyArgs;
    Okular::Part part(nullptr, nullptr, dummyArgs);
    QVERIFY(openDocument(&part, QStringLiteral(KDESRCDIR "data/file2.pdf")));
    part.widget()->resize(600, 400);
    part.widget()->show();
    QVERIFY(QTest::qWaitForWindowExposed(part.widget()));
    QTest::qWait(3000);
    auto we = new QWheelEvent({}, {}, {}, {0, -150}, Qt::NoButton,
Qt::NoModifier, Qt::NoScrollPhase, false);
    QCoreApplication::postEvent(part.m_pageView->viewport(), we);
    QTest::qWait(3000);
}



The QWheelEvent definition is a bit "bogus" in which it doesn't define pos nor
globalPos, just abuses the knowledge that PageView::wheelEvent just uses the
angleDelta().y()

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Okular-devel mailing list