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

Usage of required properties breaks ComboBox

    XMLWordPrintable

Details

    Description

      When writing a ComboBox delegate, the properties modelData and index become unavailable if the delegate makes use of components with required properties:

      ReferenceError: modelData is not defined
      ReferenceError: index is not defined
      

      Removing the "required" keyword circumvents the problem.

      Reproduction

      Example project and screenshots attached. The code runs fine when removing the "required" keywords from both MyDelegate.qml and MyText.qml. When the "required" keywords are not removed, the popup breaks visually and yields the following error:

      ReferenceError: modelData is not defined
      

      Attachments

        1. Actual behavior.png
          Actual behavior.png
          62 kB
        2. Expected behavior.png
          Expected behavior.png
          63 kB
        3. qtbug-100937.zip
          3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtqmlteam Qt Qml Team User
            nikwen Niklas Wenzel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes