[SOLVED]Empty hash property.



  • I have next JsonObject:
    @QJsonObject result;
    result["objectType"] = QString("objects.Words");
    result["hash"] = QString::number(word.hash());
    result["name"] = word.wordName();
    result["fromLanguage"] = word.fromLanguage();
    result["toLanguage"] = word.toLanguage();
    result["rate"] = rate;@

    Word hash function returned uint value that is rsult of qHash function.
    For example my json object may be next:
    @QJsonObject({"fromLanguage": "ru","hash": "3541909354","name": "дом","objectType": "objects.Words","rate": 30,"toLanguage": "en"}) @

    I use next fucntion for creation this object:
    @m_pEnginioClient->create(result);@

    The object is created and have next imagine:
    @{
    "fromLanguage": "ru",
    "hash": {},
    "name": "дом",
    "rate": 30,
    "toLanguage": "en"
    }@

    Hash property have type "hash".
    What happen with hash value?



  • Maybe Enginio backend element type contains "hash" keyword that may implicitly conflict with your key "hash".


  • cid:52:privileges:purge

    Property type "Hash" can be used to store objects in json format, like
    @{
    "key1": "value1",
    "key2": "value2"
    }@

    You might want to use Number or String type to store your hash values



  • [quote author="nevalla" date="1400750186"]Property type "Hash" can be used to store objects in json format, like
    @{
    "key1": "value1",
    "key2": "value2"
    }@

    You might want to use Number or String type to store your hash values[/quote]

    Ok, now understand! But where I can read about this?


Log in to reply
 

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