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

JS object property name requires quotes in a declaration

XMLWordPrintable

    • 89cdaa901d227bed35f6c5405ce5d62f352a659c

      The following example fails, but works if myProp is changed to 'myProp' (with quotes)

      import QtQuick 2.0
      Item {
          property var myObjProp: { myProp: 'true' }
          Component.onCompleted: console.log(myObjProp.myProp)  //prints 'undefined'
      }
      

      The quotes are not required in an imperative code block.

        For Gerrit Dashboard: QTBUG-23388
        # Subject Branch Project Status CR V

            chriadam Christopher Adams (closed Nokia identity) (Inactive)
            brasser Michael Brasser (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes