I think it would be cleaner (just an opinion) to use a couple of functions to populate the ListModel. You would of course need to add a line to fillScreenListModel() for every additional item you added in your case statement.
@ function makeObject(roleName, value)
{
return {"name": roleName, "info": value}
}
function fillScreenListModel()
{
var dataArray = [],
i=0
dataArray[i++] = makeObject("Screen width",Screen.width)
dataArray[i++] = makeObject("Screen height",Screen.height)
dataArray[i] = makeObject("Pixel density",Math.floor(Screen.logicalPixelDensity*100)/100)
//Now move each object into the ListModel
dataArray.forEach(function(element){infoModel.append(element)})
}@
Then your ListModel could look like this:
@ ListModel {
id: infoModel
Component.onCompleted: fillScreenListModel()
}@
If you want to format pixelDensity as a string using toFixed(2), then add toString() to the other numbers so that all the info roles are strings.