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

Qt Quick Controls 1 TableView prints model size error messages

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.12, 5.15
    • Quick: Controls 1
    • None
    • Windows

    Description

      If a QQC TableView has more entries than its height would fit, the Repeater in the Column with the id: rowfiller in the BasicTableView.qml calculates a negative model size which results in error messages like:

      Model size of -1 is less than 0

      This can be tested with a minimal example:

      // main.qml
      import QtQuick 2.15
      import QtQuick.Window 2.15
      import QtQuick.Controls 1.4 as QQC
      
      Window {
          width: 640
          height: 80
          visible: true
          title: qsTr("Model Size Issue")
      
          QQC.TableView {
              anchors.fill: parent
      
              model: ListModel {
                  ListElement { name: "Row 1" }
                  ListElement { name: "Row 2" }
                  ListElement { name: "Row 3" }
                  ListElement { name: "Row 4" }
                  // add/remove elements beyond the 4th to get the error message
                  ListElement { name: "Row 5" }
              }
      
              QQC.TableViewColumn {
                  role: "name"
                  title: "Rows"
              }
          }
      }
      

      A similar (closed) issue had been raised for the TreeView some time ago:
      QTBUG-72543

      Attachments

        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
            pdietz Pascal Dietz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes