Git Product home page Git Product logo

Comments (5)

Skycoder42 avatar Skycoder42 commented on July 20, 2024

I am not shure where your problem comes from, but generally, maps do work, as Q_PROPERTY actually is a variadic macro on compilers that support it (See qobjectdefs.h:109).

In testgadget.h:67 you can see me using maps - and that compiles completely fine, as you can see in all the CI-builds. So at least on the support platforms, it should work.

Which platform are you on, what compiler and compiler version are you using and which version of Qt are you trying to use the library with? That will help narrow down from where the error comes.

from qtjsonserializer.

ulmino avatar ulmino commented on July 20, 2024

from qtjsonserializer.

Skycoder42 avatar Skycoder42 commented on July 20, 2024

I guess thats the reason. You can try switching the code model you are currently using.Either the internal codemodel is not able to detect this correctly, or the clang is not able to detect the compiler-features of mingw correctly - I can't say which one it is.

Simply check which one is active, the internal or the clang code model and the enable or disable the clang codemodel plugin based on that.

Also: I would like to keep this issue open because of the second part of it:

Could you add a example how to use QMap with custom class to serialize and deserialize?

I will close this issue once I got the chance to do that.

Und schönen Gruß zurück!

from qtjsonserializer.

Skycoder42 avatar Skycoder42 commented on July 20, 2024

As a sidenote: I am also experiencing this in Qt Creator now. aparrently clang detects the macro definition wrong.

A simle workaround is to add a ifdef around the statement the disables it unless moc is run:

#ifdef Q_MOC_RUN //workaround for clang code model
	Q_PROPERTY(QMap<QString, int> property MEMBER property);
#endif

from qtjsonserializer.

Skycoder42 avatar Skycoder42 commented on July 20, 2024

I have now added support for typedefs to the library. See https://github.com/Skycoder42/QtJsonSerializer#support-for-using-and-typedef.

You can already get it from the master branch or wait for the next release which is due in a few days

from qtjsonserializer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.