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

Add QT_USE_NAMESPACE macro #6864

Merged
merged 1 commit into from
Oct 6, 2024
Merged

Conversation

bjornblissing
Copy link
Contributor

@bjornblissing bjornblissing commented Oct 5, 2024

The macro QT_USE_NAMESPACE should expand to nothing for most Qt builds, i.e. built with an empty QT_NAMESPACE variable.

However if Qt is built using a custom namespace then all forward declarations must be wrapped with QT_BEGIN_NAMESPACE and QT_END_NAMESPACE. Today CppCheck defines these macros as empty, thus QT_USE_NAMESPACE should be empty as well.

Reference:
https://wiki.qt.io/Qt_In_Namespace

The macro `QT_USE_NAMESPACE` should expand to nothing for most Qt builds, i.e.
built with an empty `QT_NAMESPACE` variable.
@chrchr-github chrchr-github merged commit e8f6d1f into danmar:main Oct 6, 2024
63 checks passed
ludviggunne pushed a commit to ludviggunne/cppcheck that referenced this pull request Oct 19, 2024
The macro `QT_USE_NAMESPACE` should expand to nothing for most Qt
builds, i.e. built with an empty `QT_NAMESPACE` variable.

However if Qt is built using a custom namespace then all forward
declarations must be wrapped with `QT_BEGIN_NAMESPACE` and
`QT_END_NAMESPACE`. Today CppCheck defines these macros as empty, thus
`QT_USE_NAMESPACE` should be empty as well.

Reference:
https://wiki.qt.io/Qt_In_Namespace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants