Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
5.7.1
-
None
Description
While QJsonDocument::Indented indeed produces human readable output it might also inflate resulting file size due to hardcoded usage of four tabs.
This can lead to more than doubling file size comparing to indenting with single tab (for example when storing short key and value pairs in hierarchy of multiple objects or arrays).
There already exists equivalent API in QXmlStreamWriter:
QXmlStreamWriter::setAutoFormattingIndent(int spacesOrTabs)
This property holds the number of spaces or tabs used for indentation when auto-formatting is enabled. Positive numbers indicate spaces, negative numbers tabs.
The default indentation is 4.