Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Qt types to work #2217

Closed
pylvain opened this issue Jun 24, 2020 · 1 comment
Closed

Getting Qt types to work #2217

pylvain opened this issue Jun 24, 2020 · 1 comment

Comments

@pylvain
Copy link

pylvain commented Jun 24, 2020

following #2216
I try to make Qt types work with the lib
I did this :

using qtjson = nlohmann::basic_json<QMap,QList,QString>;

It compiles
but this doesn't

qtjson j;

The compiler yells at me things like

json.hpp:16302: error: wrong number of template arguments (4, should be 2)
json.hpp:16978: error: wrong number of template arguments (4, should be 2)
json.hpp:17027: error: ‘const union nlohmann::basic_json<QMap, QList, QString>::json_value’ has no member named ‘object’

I'm a bit lost, do I have do implement functions ? Maybe did i forget to specify a type somewhere ?
Thanks in advance !

@pylvain
Copy link
Author

pylvain commented Jun 25, 2020

I made that to convert between Qt Types and standard types https://gist.github.com/pylvain/d8127d4a3da206fcd49dd05463a4cc07, should anyone need it.
The lib takes 400ms to parse a 4MB json file. Converting between QJsonType and json::value_type and then doing the reverse operation takes 800ms. It's not awful, i will use that, that's good enough for me.

Just out of curiosity, has anyone any idea on how to improve performances ?
(I will close after that)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant