qt library: Make Q_PROPERTY a variadic macro to avoid preprocessorErrorDirective#5370
Merged
chrchr-github merged 1 commit intocppcheck-opensource:mainfrom Aug 25, 2023
vb-linetco:main
Merged
qt library: Make Q_PROPERTY a variadic macro to avoid preprocessorErrorDirective#5370chrchr-github merged 1 commit intocppcheck-opensource:mainfrom vb-linetco:main
chrchr-github merged 1 commit intocppcheck-opensource:mainfrom
vb-linetco:main
Conversation
Collaborator
|
Thanks for your contribution. Can you add a test in |
Contributor
Author
Sure, I'll have a look, didn't notice there were tests for that |
Contributor
Author
I've added a test and verified, that without the (...) for the Q_PROPERTY Macro the test fails. |
vb-linetco
commented
Aug 25, 2023
Treat Q_PROPERTY as variadic macro to avoid preprocessorErrorDirective with associative container templates itroducing a "," like for example `QHash<QString, int>`. Using templates is totally fine in the context of a moc comiler. The macro Q_PROPERTY is defined as variadic in qobjectdefs.h/qtmetaobject.h when not compiling using the moc compiler. See following references: * For Qt 5.15 https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/kernel/qobjectdefs.h?h=5.15#n104 * For Qt 6.6 https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/kernel/qtmetamacros.h?h=6.6#n5 Add test to verify Q_PROPERTY with QHash<QString, int> works properly
Collaborator
|
Would you like to be credited as an author, and if so, which name should be used? |
Contributor
Author
Yes and please use Valentin Batz (LiNetCo GmbH), thank you. |
This was referenced Aug 26, 2023
chrchr-github
added a commit
that referenced
this pull request
Aug 26, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Treat Q_PROPERTY as variadic macro to avoid preprocessorErrorDirective with associative container templates itroducing a "," like for example
QHash<QString, int>. Using templates is totally fine in the context of a moc compiler.The macro Q_PROPERTY is defined as variadic in qobjectdefs.h/qtmetaobject.h when not compiling using the moc compiler.
See following references: