how to enable the QListWidget support touch event
-
-
[quote author="ltr6" date="1399363630"]Try QScroller:
http://qt-project.org/doc/qt-5/qscroller.html
This might also help:
http://qt-project.org/forums/viewthread/38529[/quote]
Thank you; but I really didn't understand how can I make my QListWidget supports Touch. I really need some simple snippet.
-
There was a snippet, I'll paste it here:
@QScrollerProperties sp;
sp.setScrollMetric(QScrollerProperties::DragVelocitySmoothingFactor, 0.6);
sp.setScrollMetric(QScrollerProperties::MinimumVelocity, 0.0);
sp.setScrollMetric(QScrollerProperties::MaximumVelocity, 0.5);
sp.setScrollMetric(QScrollerProperties::AcceleratingFlickMaximumTime, 0.4);
sp.setScrollMetric(QScrollerProperties::AcceleratingFlickSpeedupFactor, 1.2);
sp.setScrollMetric(QScrollerProperties::SnapPositionRatio, 0.2);
sp.setScrollMetric(QScrollerProperties::MaximumClickThroughVelocity, 0);
sp.setScrollMetric(QScrollerProperties::DragStartDistance, 0.001);
sp.setScrollMetric(QScrollerProperties::MousePressEventDelay, 0.5);QScroller* scroller = QScroller::scroller(yourListWidget);
scroller->grabGesture(yourListWidget, QScroller::LeftMouseButtonGesture);
scroller->setScrollerProperties(sp);@
On lines 13 and 15 you need to give your list widget as the parameter.