Skip to content

Commit e8f6d1f

Browse files
Add QT_USE_NAMESPACE macro (danmar#6864)
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
1 parent 62127a8 commit e8f6d1f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cfg/qt.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5368,6 +5368,7 @@
53685368
<define name="Q_RETURN_ARG(type, data)" value="QReturnArgument&lt;type &gt;(#type, data)"/>
53695369
<define name="Q_UNLIKELY(expr)" value="expr"/>
53705370
<define name="Q_UNUSED(X)" value="(void)(X);"/>
5371+
<define name="QT_USE_NAMESPACE" value=""/>
53715372
<define name="QT_BEGIN_NAMESPACE" value=""/>
53725373
<define name="QT_END_NAMESPACE" value=""/>
53735374
<define name="QT_BEGIN_MOC_NAMESPACE" value=""/>

0 commit comments

Comments
 (0)