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

TypeError warnings from attached property usage in tst_qquicklistview

    XMLWordPrintable

Details

    • dbd108a799 (qt/qtdeclarative/dev) dbd108a799 (qt/tqtc-qtdeclarative/dev) a1aed700df (qt/tqtc-qtdeclarative/6.2) 538c36af0a (qt/qtdeclarative/6.4) 6f523b0bce (qt/qtdeclarative/6.3) 6f523b0bce (qt/tqtc-qtdeclarative/6.3)

    Description

      Running tst_qquicklistview attachedProperties_QTBUG_32836 results in this output:

      QWARN  : tst_QQuickListView::attachedProperties_QTBUG_32836() file:///Users/mitch/dev/qt-dev2/qtdeclarative/tests/auto/quick/qquicklistview/data/attachedProperties.qml:74:5: TypeError: Cannot read property 'width' of null
      QWARN  : tst_QQuickListView::attachedProperties_QTBUG_32836() file:///Users/mitch/dev/qt-dev2/qtdeclarative/tests/auto/quick/qquicklistview/data/attachedProperties.qml:78:5: TypeError: Cannot read property 'width' of null
      QWARN  : tst_QQuickListView::attachedProperties_QTBUG_32836() file:///Users/mitch/dev/qt-dev2/qtdeclarative/tests/auto/quick/qquicklistview/data/attachedProperties.qml:82:5: TypeError: Cannot read property 'width' of null
      PASS   : tst_QQuickListView::attachedProperties_QTBUG_32836()
      

      The QML code looks fine:

      import QtQuick 2.0
      
      ListView {
        width: 100
        height: 100
      
        Component.onCompleted: currentIndex = 0
      
        model: ListModel {
          ListElement {
            name: "A"
          }
          ListElement {
            name: "B"
          }
        }
      
        delegate: Text {
          width: ListView.view.width
          text: model.name
        }
      
        header: Rectangle {
          width: ListView.view.width
        }
      
        footer: Rectangle {
          width: ListView.view.width
        }
      
        highlight: Rectangle {
          width: ListView.view.width
        }
      
        section.property: "name"
        section.criteria: ViewSection.FirstCharacter
        section.delegate: Rectangle {
          objectName: "sectionItem"
          width: ListView.view.width
        }
      
      }
      

      Attachments

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

        Activity

          People

            mitch_curtis Mitch Curtis
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: