Document and further test that QJsonObject::keys() is sorted.

Change-Id: I6b145c1240cce85ad3fea6fb90ddbed629487f83
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
Mitch Curtis 2015-01-22 10:38:34 +01:00 committed by Mitch Curtis
parent 51ce5b4829
commit fe1726fd7d
2 changed files with 4 additions and 0 deletions

View File

@ -223,6 +223,8 @@ QVariantMap QJsonObject::toVariantMap() const
/*!
Returns a list of all keys in this object.
The list is sorted lexographically.
*/
QStringList QJsonObject::keys() const
{

View File

@ -1051,6 +1051,8 @@ void tst_QtJson::keySorting()
QCOMPARE(it.key(), QLatin1String("A"));
++it;
QCOMPARE(it.key(), QLatin1String("B"));
QCOMPARE(o.keys(), QStringList() << QLatin1String("A") << QLatin1String("B"));
}
void tst_QtJson::undefinedValues()