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

Inconsistent behavior of list property in QML

    XMLWordPrintable

Details

    Description

      There are two inconsistency in list property of QML.

      1. trailing comma is only allowed for id list
      2. mixing id and declaration in list is not allowed.

      import QtQuick 2
      
      Item {
          Item { id: item1 }
          Item { id: item2 }
      
          property list<Item> list2: [
              item1,
              item2, // OK, trailing comma is allowed
          ]
      
          property list<Item> list1: [
              Item {},
              Item {}, // Error: trailing comma is not allowed here
          ]
      
          property list<Item> list3: [
              Item {},
              item1 // Error: mixing id and item declaration is not allowed
          ]
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              qtqmlteam Qt Qml Team User
              xylosper Byoung-young Lee
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes