[Interest] QJsonObject::value() - Undefined or Null upon non-existing key

Wiebe Cazemier wiebe at halfgaar.net
Thu Jun 26 11:00:32 CEST 2014


----- Original Message -----
> From: "Wiebe Cazemier" <wiebe at halfgaar.net>
> To: interest at qt-project.org
> Sent: Wednesday, 25 June, 2014 2:31:49 PM
> Subject: [Interest] QJsonObject::value() - Undefined or Null upon	non-existing key
> 
> Hi,
> 
> The docs for QJsonObject::operator[] say [1]:
> 
> > The returned QJsonValue is QJsonValue::Undefined if the key does not exist.
> 
> Yet:
> 
> ==
> QJsonValue var = responseVariables["IDontExist"];
> var.isUndefined() -> false;
> var.isNull() -> true;
> 
> qDebug() << var;
> QJsonValue(null)
> ==
> 
> I use Qt 5.1.1.
> 
> Regards,
> 
> Wiebe Cazemier
> 
> 
> 
> [1] http://qt-project.org/doc/qt-5/qjsonobject.html#operator-5b-5d

I created a bug report:

https://bugreports.qt-project.org/browse/QTBUG-39864



More information about the Interest mailing list