Unsolved How to set finger scrolling in Qt 5.7
-
Hello,
I'm trying to scroll screen using finger in Qt Creator 4.0.2 but unfortunately unable to succeed.
Here is my codeQScrollArea *scrollArea; QWidget *scrollAreaWidgetContents; scrollArea = new QScrollArea(settingsWindowBk); scrollArea->setObjectName(QStringLiteral("scrollArea")); scrollArea->setGeometry(QRect(70, 70, 341, 200)); scrollArea->setWidgetResizable(true); scrollAreaWidgetContents = new QWidget(); scrollAreaWidgetContents->setObjectName(QStringLiteral("scrollAreaWidgetContents")); scrollAreaWidgetContents->setGeometry(QRect(0, 0, 339, 198)); scrollArea->setWidget(scrollAreaWidgetContents);
ui->scrollArea->viewport()->setAttribute(Qt::WA_AcceptTouchEvents);
QScroller::grabGesture(ui->scrollArea->viewport(),QScroller::TouchGesture);Still not able to scroll using gesture.
Any Advice.
Thank you
-
@jigarp What is your device and OS?
-
Hello,
I'm using Qt 5.7 cross compiling for am335x based board which contains arago linux 4.9.28 based kernel -
@jigarp And touch screen is working?
-
@jsulm
Everything is working fine.
like Touch,display,motion etc
Can you provide me procedure for enabling finger scrolling/kinetic scrolling in Qt creatorI've many doubts like scrollArea ,scrollAreaWidgetContents size etc.
Thank you,
-
Does gesture requires multi touch functionality???
-
@jigarp Depends on the gesture: for scrolling you only need one finger.
-
@jsulm
So can you provide any sample for scroll area to scroll with finger scrolling in Qt creator -
@jigarp I don't know whether there are any examples for this. You can check Qt examples by yourself. Actually it should work out of the box if the touch screen is working on your device.
-
@jsulm
What will be the size/geometry for scrollArea and scrollAreaWidgetContents for scrolling that widget.
Because scrollAreaWidgetContents must be larger than scrollArea for scrolling mechanism.