Reputation: 1123
i use this code to enable touch screen in QListWidget
ui->listWidget->setAttribute(Qt::WA_AcceptTouchEvents,true);
ui->listWidget->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
ui->listWidget->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
QScroller::grabGesture(ui->listWidget,QScroller::TouchGesture);
the touch works great with no problems. but I have a double click signal on the QListWidget, when I double-clicking on an item in list widget the double click slot not work ?
the problem appears especially when the items need to be scrolled (many numbers of item's in list) but if the item's number is small not need to be scroll it works fine
How can I solve this problem
Thanks in Advance
Upvotes: 4
Views: 1130
Reputation: 46
Try this workaround:
QScroller::grabGesture(ui->listWidget, QScroller::LeftMouseButtonGesture);
Upvotes: 3