Skip to content

Commit 45fe1e1

Browse files
committed
cfg/qt.cfg - Change the Q_D definition to avoid false positives
Change the O_D macro definition by moving the 'const' qualifier to the front of the statement. Without this change we get false positives "style: Variable 'd' can be declared as pointer to const [constVariablePointer]" The current definition follows Qt correctly as we see this define in the `QtCore/qtclasshelpermacros.h` file: Q_D(Class) Class##Private * const d = d_func() but apparently cppcheck doesn't properly recognize that as a const variable pointer.
1 parent 6f50382 commit 45fe1e1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cfg/qt.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5315,7 +5315,7 @@
53155315
<!-- Treat QStringList as QList<QString> since we can't remove the template parameter when we inherit. -->
53165316
<define name="QStringList" value="QList&lt;QString&gt;"/>
53175317
<define name="Q_ARG(type, data)" value="QArgument&lt;type &gt;(#type, data)"/>
5318-
<define name="Q_D(Class)" value="Class##Private * const d = d_func()"/>
5318+
<define name="Q_D(Class)" value="const Class##Private *d = d_func()"/>
53195319
<define name="Q_CLASSINFO(Name, Value)" value=""/>
53205320
<define name="Q_EXPORT_PLUGIN(ClassName)" value=""/>
53215321
<define name="Q_EXPORT_PLUGIN2(a,ClassName)" value=""/>

0 commit comments

Comments
 (0)