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

Regression: Javascript array push() method doesn't work on QStringList

    XMLWordPrintable

Details

    • a1b6db4765d89b0081788e98dcdfdba5ed7fa121

    Description

      Please run the following code in qmlscene:

      import QtQuick 2.0
      
      DropArea {
          keys: ["cat"]
      
          Component.onCompleted: {
              console.log("My animals at start: " + keys)
              keys.push("dog")
              console.log("My animals after push: " + keys)
              keys[keys.length] = "dog"
              console.log("My animals after insert: " + keys)
          }
      }
      

      Under Qt 5.0, this prints:

      My animals at start: cat
      My animals after push: cat,dog
      My animals after insert: cat,dog,dog
      

      But under Qt 5.2, the push() method inserts an empty string:

      My animals at start: cat
      My animals after push: cat,
      My animals after insert: cat,,dog
      

      Attachments

        Issue Links

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

          Activity

            People

              mardy Alberto Mardegan
              mardy Alberto Mardegan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes