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
QtWS25 Last Chance

QCombobox scrolling in touchscreen device

Scheduled Pinned Locked Moved General and Desktop
qcomboboxtouch screenscroll
5 Posts 4 Posters 4.8k Views
  • 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 last edited by marlenet15
    #1
    This post is deleted!
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on 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

      the_T 1 Reply Last reply
      2
      • SGaistS SGaist

        Hi,

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

        Hope it helps

        the_T Offline
        the_T Offline
        the_
        wrote on 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
        • AmrCoderA Offline
          AmrCoderA Offline
          AmrCoder
          wrote on 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
          • AmrCoderA Offline
            AmrCoderA Offline
            AmrCoder
            wrote on last edited by AmrCoder
            #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