Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Kinetic scrolling on a qlistwidget select items
Forum Updated to NodeBB v4.3 + New Features

Kinetic scrolling on a qlistwidget select items

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 2 Posters 1.9k 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.
  • W Offline
    W Offline
    Whiden
    wrote on last edited by
    #1

    Hi all. I am struggling with a very basic thing, the kinetic scrolling on a QListWidget. The thing is, i have a list of items which represents links to others pages. I would like the user to be able to scroll using fingers, so for that i used

    @QScroller::grabGesture(m_list,QScroller::TouchGesture);@

    with m_list being my QListWidget.

    The problem is that when i scroll using my finger, the point where i touch the screen to start the scroll actually select an item (the item in question get the blue color, meaning it has been selected) so when I release the screen, if my finger was on an item, the signal itemPressed() is triggered, which is a problem.
    I already saw another Qt application where the app recognized the difference between a real touch and a scroll.

    I tried several solutions, like with the signal itemActivated() instead of itemPressed() or itemClicked(). The first doesn't even trigger when i touch the item.

    Does somebody knows the easy way? Thanks by advance.

    1 Reply Last reply
    0
    • W Offline
      W Offline
      Wahsekim
      wrote on last edited by
      #2

      I have the same problem. Any update, OP?

      1 Reply Last reply
      0
      • W Offline
        W Offline
        Whiden
        wrote on last edited by
        #3

        Hey there ! Yes, i managed to "cheat" for that. I don't remember exactly (and i don't have access to my code anymore) but i linked my QScroller::stateChanged to a slot i made to check the current state (inactif, dragging, etc...). There, i used a QTimer and a bool or something like that to autorize or not the app to do the action linked to the clic on the list.

        If i recall properly, it's because the onItemClicked signal is emitted when the user's finger release the screen, and not when he touch it. So, if there was a time too long between the touch on the screen and the release of the finger, I blocked the onItemClicked action, assuming the user was just slowly scrolling.

        It's not perfect and i don't recall the detail, I still hope it will help you somehow =)

        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