Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QListWidget Item selection and Scroll for Touchscreen
Forum Updated to NodeBB v4.3 + New Features

QListWidget Item selection and Scroll for Touchscreen

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 313 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    destinycode
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved