← Back to team overview

ubuntu-sdk-bugs team mailing list archive

[Bug 1273684] [NEW] Qt 5.2: JS Array.push() doesn't work on QStringList

 

Public bug reported:

See:

https://bugreports.qt-project.org/browse/QTBUG-36491


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

** Affects: qtdeclarative-opensource-src (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
SDK bug tracking, which is subscribed to qtdeclarative-opensource-src in
Ubuntu.
https://bugs.launchpad.net/bugs/1273684

Title:
  Qt 5.2: JS Array.push() doesn't work on QStringList

Status in “qtdeclarative-opensource-src” package in Ubuntu:
  New

Bug description:
  See:

  https://bugreports.qt-project.org/browse/QTBUG-36491


  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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qtdeclarative-opensource-src/+bug/1273684/+subscriptions


Follow ups

References