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

ComboBox.qml:56: TypeError: Cannot read property 'width' of null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.15.0
    • Quick: Controls 2
    • None
    • Windows

      When scrolling ComboBox with large number of elements I see this warning in console.

      file:///C:/Qt/5.15.0/msvc2019_64/qml/QtQuick/Controls.2/ComboBox.qml:56: TypeError: Cannot read property 'width' of null

      I was able to "fix" it by changing line 56 from

      width: parent.width

      to

      width: parent ? parent.width : 100

       

      Minimal reproducible example is attached. It is just ComboBox with big model.

      P.S. probably QTBUG-81976 is related

        1. combobx-bug-mre.pro
          0.1 kB
          Mikhail
        2. main.cpp
          0.6 kB
          Mikhail
        3. main.qml
          4 kB
          Mikhail
        4. qml.qrc
          0.1 kB
          Mikhail
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            asc7uni Mikhail
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes