how to prevent the QJSONObject to sort by the keys?
-
When i insert into the key ,values by using the QJSONObject.
It always sorted by the keys.and after inserting the keys and values,I dont konw the pre order before inserted the OJSONObject.
Is there a data object to do that? -
When i insert into the key ,values by using the QJSONObject.
It always sorted by the keys.and after inserting the keys and values,I dont konw the pre order before inserted the OJSONObject.
Is there a data object to do that?@nicker-player JSON does not specify any specific order for the objects. If you really need that you will need to implement that by yourself.
-
When i insert into the key ,values by using the QJSONObject.
It always sorted by the keys.and after inserting the keys and values,I dont konw the pre order before inserted the OJSONObject.
Is there a data object to do that?@nicker-player
As @jsulm says. The order is undefined and that is how QtQJson...sorts output. If you search this forum there have been several long discussions about this a while ago. One of them elected to use some third-party library to do their desired JSON output sorting. I cannot recall what that was, whether it was Python, whether it's available to you....