Skip to content

Commit

Permalink
Doc: Improve QJsonDocument::fromJson documentation
Browse files Browse the repository at this point in the history
Be explicit on how to check whether parsing succeeds.

Change-Id: I44f408cb6e5a830826b84dfb3a8af331f03e58cc
Reviewed-by: Topi Reiniö <[email protected]>
  • Loading branch information
kkoehne committed Jul 1, 2016
1 parent c3f645a commit 9964b85
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/corelib/json/qjsondocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,16 +351,14 @@ QByteArray QJsonDocument::toJson(JsonFormat format) const
#endif

/*!
Parses a UTF-8 encoded JSON document and creates a QJsonDocument
Parses \a json as a UTF-8 encoded JSON document, and creates a QJsonDocument
from it.
\a json contains the json document to be parsed.
Returns a valid (non-null) QJsonDocument if the parsing succeeds. If it fails,
the returned document will be null, and the optional \a error variable will contain
further details about the error.
The optional \a error variable can be used to pass in a QJsonParseError data
structure that will contain information about possible errors encountered during
parsing.
\sa toJson(), QJsonParseError
\sa toJson(), QJsonParseError, isNull()
*/
QJsonDocument QJsonDocument::fromJson(const QByteArray &json, QJsonParseError *error)
{
Expand Down

0 comments on commit 9964b85

Please sign in to comment.