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

Bug #1273684 reported by Alberto Mardegan
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qtdeclarative-opensource-src (Ubuntu)
Fix Released
Undecided
Timo Jyrinki

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

Related branches

Changed in qtdeclarative-opensource-src (Ubuntu):
assignee: nobody → Timo Jyrinki (timo-jyrinki)
Changed in qtdeclarative-opensource-src (Ubuntu):
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtdeclarative-opensource-src - 5.2.1-3ubuntu10

---------------
qtdeclarative-opensource-src (5.2.1-3ubuntu10) trusty; urgency=medium

  * debian/patches/Fix-crash-when-appending-arrays-to-sub-models-in-lis.patch
    - Backport from upstream https://codereview.qt-project.org/#change,80934
      (LP: #1291602)
 -- Timo Jyrinki <email address hidden> Fri, 14 Mar 2014 09:37:56 +0000

Changed in qtdeclarative-opensource-src (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.