Enginio backend type "array" cannnot be converted to json in client



  • In Enginio I use array type to upload example:

    @map array custom [-----in Enginio backend------]@

    and I use the following code to create:

    @var map = JSON.parse( rs.rows.item( 0 ).map );@

    Note "rs.rows.item( 0 ).map" is a valid string with rectangle parentheses[]
    when I use a costom delegate to represent data in another client, things get wrong: the type is no longer array, rather it becomes object.
    I use the following code to examine:

    @console.log( map );
    console.log( typeof( map ) );
    console.log( JSON.stringify( map ) );@

    the result shows:

    @qml: QQmlListModel(0x725b220)
    qml: object
    qml: {"objectName":"","count":128,"dynamicRoles":false}@

    My question is: how to convert this object into original json array? Thanks in advance.



  • bq. Note “rs.rows.item( 0 ).map” is a valid string with rectangle parentheses[]

    it is not a valid string, it is:

    bq. @qml: QQmlListModel(0x725b220)@


Log in to reply
 

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