QT Translation: JSON support in QT (JSON has only six data types)

Source: Internet
Author: User

JSON support in Qt QT5 begins with supporting the processing of JSON data, which is a data format for Interter data interchange. JSON is used to store structured data, and JSON has 6 basic data types:
bool Double String Array Object Null
All keys is strings, and an object cannot contain any duplicate keys. In a JSON object, all keys are strings and cannot contain duplicate strings. Entries in arrays and objects is separated by commas. The separator between keys and values in an object are a colon (:). In JSON, keys and values are separated by ":", and multiple key-value pairs are separated by ",". A valid JSON document is either an array or an object, so a document always starts with a square or curly bracket. Valid JSON text This is an array or an object, so the JSON text always starts with brackets or curly braces. Example:
{
"FirstName": "John",
"LastName": "Doe",
"Age": 43,
"Address": {
"Street": "Downing Street 10",
"City": "London",
"Country": "Great Britain"
},
"Phone numbers": [
"+44 1234567",
"+44 2345678"
]
}
JSON-related classes in QT
Qjsonarray Encapsulates a JSON array Encapsulating JSON arrays
Qjsondocument The to read and write JSON documents How JSON text is read and written
Qjsonobject Encapsulates a JSON object Encapsulating JSON objects
Qjsonobject::iterator Qjsonobject::iterator class provides an stl-style Non-const iterator for Qjsonobject JSON iterator
Qjsonobject::const_iterator Qjsonobject::const_iterator class provides a Stl-style const iterator for Qjsonobject JSON Const iterator
Qjsonparseerror Used to report errors during JSON parsing Used to report errors during JSON parsing
Qjsonvalue Encapsulates a value in JSON Encapsulates a value in JSON

http://blog.csdn.net/jan5_reyn/article/details/38955721

QT Translation: JSON support in QT (JSON has only six data types)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.