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
    	};
    	
    	console.log(JSON.stringify(obj));
    	// show {attribute1: 'value ok', attribute2 : null}
    	
    	myList.append(obj);
    	console.log(JSON.stringify(myList));
    	// show only {attribute1: 'value ok'}
    }


  • 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
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.