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

ListView cannot be scrolled horizontally.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • 5.14.1, 5.14.2
    • Quick: Controls 2
    • None
    • Linux Gentoo x86_64
    • Linux/X11

    Description

      Using QtQuick.Controls 2.0 I am not able to get a horizontal scrollbar for a ListView working.

      I have verified this by using the projects and examples included in QTBUG-52553 ('GridView_ScrollBar.tar.gz' and an implementation of the not working version).

      I have attached 'GridView_ScrollBar.tar.gz'.

      import QtQuick 2.7
      import QtQuick.Controls 2.0
      
      ApplicationWindow {
          visible: true
          width: 640
          height: 480
          Rectangle {
              width: 400;
              height: 300;
      
              GridView {
                  id: list;
      
                  width: parent.width
                  height: parent.height
                  contentWidth:  parent.width * 4
                  contentHeight:   parent.width * 4
                  model: 20;
                  clip : true
                  flickableDirection: Flickable.HorizontalAndVerticalFlick
                  delegate: Rectangle {
                      height: 50;
                      width: parent.width;
                      color: (model.index %2 === 0 ? "darkgray" : "lightgray");
                  }
                  ScrollBar.vertical: ScrollBar{
                      contentItem: Rectangle {
                          implicitWidth: 6
                          implicitHeight: 100
                          radius: width / 2
                          color: "black"
                      }}
                  ScrollBar.horizontal:  ScrollBar{contentItem: Rectangle {
                          implicitWidth: 100
                          implicitHeight: 6
                          radius: width / 2
                          color: "black"
                      }}
              }
      
          }
          Component.onCompleted: {
              console.log("WIdth : "+list.width + "ContentWidth : "+list.contentWidth);
              console.log("Height :"+list.height + "COntentHeight : "+list.contentHeight)
              console.log( "Width Ratio : "+ list.visibleArea.widthRatio);
              console.log("Height Ratio : "+list.visibleArea.heightRatio);
          }
      }
      

      Attachments

        1. GridView_ScrollBar.tar.gz
          1 kB
          P.G.C.M. Sliepenbeek

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              petersliepenbeek P.G.C.M. Sliepenbeek
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes