Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-20234

The QML auto format function destroys JSON notation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • Qt Creator 4.6.0
    • Quick / QML Support
    • None

    Description

      For example, the animal property below defines a JavaScript object defined with JSON notation:

      Item {
          property variant animal : { 'type': 'bird', 'species': 'galah', 'age': 7 }
      
          Component.onCompleted: {
              for (var attribute in animal)
                  console.log(attribute, "=", animal[attribute])
          }
      }
      

       

       

      After qml formatting, the character ' is missing:

      Item {
          property variant animal: {
              type: 'bird',
                    species: 'galah',
                    age: 7
          }
      
      
          Component.onCompleted: {
              for (var attribute in animal)
                  console.log(attribute, "=", animal[attribute])
          }
      }
      

       

      Attachments

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

        Activity

          People

            mabenell Marco Benelli
            michael-doennebrink Michael Dönnebrink
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes