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. QCombobox scrolling in touchscreen device
Forum Updated to NodeBB v4.3 + New Features

QCombobox scrolling in touchscreen device

Scheduled Pinned Locked Moved General and Desktop
qcomboboxtouch screenscroll
5 Posts 4 Posters 4.9k Views 2 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.
  • M Offline
    M Offline
    marlenet15
    wrote on 9 Feb 2016, 18:29 last edited by marlenet15 2 Sept 2016, 22:10
    #1
    This post is deleted!
    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 9 Feb 2016, 22:18 last edited by
      #2

      Hi,

      The drop down from QComboBox is a QAbstractItemView which inherits from QAbstractScrollArea. You can try to apply flickcharm on it.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      T 1 Reply Last reply 10 Feb 2016, 07:12
      2
      • S SGaist
        9 Feb 2016, 22:18

        Hi,

        The drop down from QComboBox is a QAbstractItemView which inherits from QAbstractScrollArea. You can try to apply flickcharm on it.

        Hope it helps

        T Offline
        T Offline
        the_
        wrote on 10 Feb 2016, 07:12 last edited by
        #3

        @SGaist
        Although the original posting was deleted and nobody knows what the exact problem was or what the opener already tried, this solution worked for me:

        QScroller::grabGesture(ui->combo->view()->viewport(),QScroller::LeftMouseButtonGesture);
        

        The scrollarea of the combobox can be scrolled with one finger on touch devices or using a touchpad/mouse with leftclick+mousemove

        -- No support in PM --

        1 Reply Last reply
        5
        • A Offline
          A Offline
          AmrCoder
          wrote on 4 Nov 2016, 11:45 last edited by
          #4

          Thank you @the_ it's work fine i know it's been a long time for this question but i hope i got answer

          QScroller::grabGesture(ui->combo->view()->viewport(),QScroller::LeftMouseButtonGesture);
          

          but it's very fast i mean if i have a comobox that contain for example 1000 number from 1 to 1000
          it scroll very fast when i scroll down it get to the end if i want to scroll up it go to the first how can i move slowly i do that in QListWidget

          ui->listWidget->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
          

          so i can move on all items in the list
          it there any way to do it on QComboBox
          Thank you

          1 Reply Last reply
          0
          • A Offline
            A Offline
            AmrCoder
            wrote on 4 Nov 2016, 11:48 last edited by AmrCoder 11 Apr 2016, 11:49
            #5

            I solve it I use the same thing

            ui->comboBox->view()->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
            

            if there is a better solution please post it
            Thanks

            1 Reply Last reply
            1

            • Login

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