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
-
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
-
Hello,
I'm using Qt 5.7 cross compiling for am335x based board which contains arago linux 4.9.28 based kernel -
@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.