Details
-
Suggestion
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.0.0 Beta 2
-
None
Description
I was trying out Qt5 beta2 these days. One thing troubles me a lot. When I use QJsonObject. I wrote the following:
jsonObject["a"] = "b";
surely it won't work, since QJsonValue requires "b" not to be confused with bool. One way to solve this is:
jsonObject["a"] = QString("b");
And another, which is more recommended (I suppose):
jsonObject["a"] = QStringLiteral("b");
Both of them work well, but require some coding.
While some people may be against using QStringLiteral for every char * style string, I personally want to add QStringLiteral to every one of them after reading the blog related to QStringLiteral.
So what I suggest is maybe adding a switch for compiling or a parameter in .pro file which will generate QStringLiteral for every char * style strings. This can largely simpify my code and do a lot of performance boost.
Thank you for reading...