I am reading a JSON file using Qfile. Storing it in to a Qstring
object. While passing the QStrin
g object to Parser::parse()
, it is showing the compilation error as The function parse()
only accepts QIODevice*
or const QByteArray&
as first argument.
The exact error message is:
no matching function for call to QJson::Parser::(QString,bool*)
candidates are Qvariant QJson::Parser::parse(QIODevice*,bool*)
note QVariant Qjson::Parser::parse(const QByteArray&,bool*)
I tried to cast QString
to QIODevice
and QByteArray
, but all in vain.