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

ListView draws outside it's own BoundingRect

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 4.7.1
    • None
    • Linux Desktop Ubuntu Karmic x86-32bit

    Description

      ListView elements are affected by a weird behaviour of Drawing.
      They draw "outside" the BoundingRect that is initially assigned to them.

      Given a portion of code like this one:

      NiceTooltip.qml
      ...
         ToolTip {
            id: orangeToolTip
            attachTo: orange
            orientation: 2
            width: 300; height: 300;
            z: 3
      
            Rectangle {
               color: "green"
               radius: 5
               anchors.fill: parent
               anchors.margins: 5
               z: -1
      
               ListView {
                  id: lista
                  anchors.fill: parent
                  model: mode
                  delegate: compo
                  overShoot: true
                  pressDelay: 200
      
                  ScrollBar {
                     verticalOrientation: true
                     whenToShow: parent.moving
                     positionInContent: parent.visibleArea.yPosition
                     visibleContent: parent.visibleArea.heightRatio
                     width: 8
                     anchors.top: parent.top
                     anchors.right: parent.right
                     anchors.bottom: parent.bottom
                     z: 3
                  }
               }
      
               Component {
                  id: compo
      
                  Rectangle {
                     border.color: "#888"
                     border.width: 1
                     width: if (parent) parent.width
                     height: 30
                     Text { text: model.testo; anchors.centerIn: parent; }
                  }
               }
      
               ListModel {
                  id: mode
                  ListElement {
                     testo: "Primo"
                  }
                  ListElement {
                     testo: "Secondo"
                  }
                  ListElement {
                     testo: "Terzo"
                  }
                  ListElement {
                     testo: "Quarto"
                  }
                  ListElement {
                     testo: "Quinto"
                  }
                  ListElement {
                     testo: "Sesto"
                  }
                  ListElement {
                     testo: "Settimo"
                  }
                  ListElement {
                     testo: "Ottavo"
                  }
               }
            }
         }
      

      The drawing of the ListElements goes beyond the limits of the ListView.
      I attach screenshots to show the actual result: what I do in the screenshots is to scroll up through a dummy-data list.

      This will show what happens while scrolling for the elements in the middle AND the even more buggy behaviour for the FIRST and LAST element in the list.

      Attachments

        1. 01.png
          41 kB
          Ivan De Marino
        2. 02.png
          38 kB
          Ivan De Marino
        3. 03.png
          13 kB
          Ivan De Marino
        4. 04.png
          11 kB
          Ivan De Marino
        5. 05.png
          14 kB
          Ivan De Marino

        Issue Links

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

          Activity

            People

              martjone Martin Jones (closed Nokia identity) (Inactive)
              detro Ivan De Marino
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes