Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-111451

ComboBox in Drawer not scrollable with mouse wheel

    XMLWordPrintable

Details

    Description

      This example has two ComboBox items with the same model, which contains 200 items.

      When you click on the one which is directly visible at startup, you can scroll in the popup with the mouse wheel, as expected.

      However, if you open the drawer by clicking the button, it will show an equal ComboBox inside a Drawer. If you open the ComboBox popup, scrolling via mouse wheel does not work. It is only scrollable by click and hold the scroll bar.

      Window {
          id: win
          width: 640
          height: 480
          visible: true
          title: "Sandbox"
      
          readonly property ListModel listModel: ListModel {
              ListElement { key: "1"; value: 0 }
              ListElement { key: "2"; value: 1 }
              // ...
              ListElement { key: "202"; value: 201 }
          }
      
          Button {
              id: btn
              anchors.centerIn: parent
              text: 'Open drawer'
              onClicked: () => drawer.open()
          }
      
          ComboBox {
              anchors {
                  horizontalCenter: parent.horizontalCenter
                  bottom: btn.top
                  bottomMargin: 50
              }
              model: win.listModel
              textRole: 'key'
          }
      
          Drawer {
              id: drawer
              width: win.width
              height: win.height
              edge: Qt.BottomEdge
      
              ComboBox {
                  anchors.centerIn: parent
                  model: win.listModel
                  textRole: 'key'
              }
          }
      }
      

      See the attached file for a complete working example.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            oulu_hillbilly Sami Varanka
            moerkb Markus Bader
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes