Skip to content

Commit b444fd4

Browse files
committed
Fix #13236: False positive: unusedFunction reported when SLOT() is used in qt code
1 parent 35f9925 commit b444fd4

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

cfg/qt.cfg

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
<reflection>
6060
<call arg="2">invokeMethod</call>
6161
</reflection>
62-
<define name="SIGNAL(X)" value="#X"/>
63-
<define name="SLOT(X)" value="#X"/>
62+
<!-- <define name="SIGNAL(X)" value="#X"/> -->
63+
<!-- <define name="SLOT(X)" value="#X"/> -->
6464
<!-- T qAbs(const T &t) -->
6565
<function name="qAbs">
6666
<pure/>

test/cfg/qt.cpp

+12-1
Original file line numberDiff line numberDiff line change
@@ -811,4 +811,15 @@ struct BQObject_missingOverride { // #13406
811811

812812
struct DQObject_missingOverride : BQObject_missingOverride {
813813
Q_OBJECT
814-
};
814+
};
815+
816+
class Foo { // #13236
817+
Foo();
818+
void dostuff();
819+
};
820+
821+
Foo::Foo() {
822+
connect(a, SIGNAL(dostuff()), this, SLOT(dostuff()));
823+
}
824+
825+
void Foo::dostuff() {} // Should not warn here with unusedFunction

0 commit comments

Comments
 (0)