QListWidget Item selection and Scroll for Touchscreen
-
Hello,
I am facing this issue when I am using qlistwidget on a touchscreen device. Basically, the following code works fine for scrolling in the list, but the problem arises when I am writing code to catch the item selection in the List. When I am scrolling, it also triggers the 'itemClicked' and 'itemPressed' event. So I am not able to separate the scroll and item selection in the list.
ui->listWidget->setAttribute(Qt::WA_AcceptTouchEvents,true);
ui->listWidget->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
ui->listWidget->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
QScroller::grabGesture(ui->listWidget,QScroller::TouchGesture);I am calling signal and slot on the list in the constructor to get the itemclick and itempressed event. Finally, is there a way to separate scrolling and item selection event for touchscreen in qlistwidget? Any leads or suggestion would be appreciated.