⚠️ Forum Maintenance: Feb 6th, 8am - 14pm (UTC+2)

ListModel append object with null value

  • Hello,

    I have a new bug sinse I upgraded Qt 5.5 to Qt 5.5.1. This problem didn't exist in Qt5.5.

    When I add a javascript object to a ListModel, and this object has a null value, the attribute with null value is disappearing. This is a simple example :

    ListModel {
    	id: myList
    function foo() {
    	var obj = {
    		attribute1 : 'value ok',
    		attribute2 : null
    	// show {attribute1: 'value ok', attribute2 : null}
    	// show only {attribute1: 'value ok'}

  • Qt Champions 2017

    I tried to repro the problem. First I tried the same thing on 5.5 on mac. When we print the mylist i just see the qml: {"objectName":"","count":2,"dynamicRoles":false}. I don't see anything. Is there something missing here ?

Log in to reply