Warning, /sdk/clazy/tests/old-style-connect/namespaces.cpp.fixed.expected is written in an unsupported language. File is not indexed.
0001 #include <QtCore/QObject>
0002 #include "namespaces.h" // Test that we use the most qualified name in headers
0003
0004 namespace Foo
0005 {
0006 class MyObj2 : public QObject
0007 {
0008 Q_OBJECT
0009 public Q_SLOTS:
0010 void separateNSSlot() {};
0011 };
0012 }
0013
0014 namespace Foo {
0015 class MyObj : public QObject
0016 {
0017 Q_OBJECT
0018 public:
0019
0020 public Q_SLOTS:
0021 void slot1() {};
0022 void slot2() {};
0023 Q_SIGNALS:
0024 void signal1();
0025 };
0026
0027
0028 void foo()
0029 {
0030 Foo::MyObj *o1 = new Foo::MyObj();
0031 MyObj2 *o2;
0032 QObject::connect(o1, &MyObj::signal1, o1, &MyObj::slot1); // Warning
0033 QObject::connect(o1, &MyObj::signal1, o2, &MyObj2::separateNSSlot); // Warning
0034 }
0035
0036 }
0037
0038 void foo2()
0039 {
0040 Foo::MyObj *o1;
0041 Foo::MyObj2 *o2;
0042 QObject::connect(o1, &Foo::MyObj::signal1, o1, &Foo::MyObj::slot1); // Warning
0043 QObject::connect(o1, &Foo::MyObj::signal1, o2, &Foo::MyObj2::separateNSSlot); // Warning
0044 }
0045
0046
0047 using namespace Foo; // Comes after, so shouldn't have influence
0048 int main() { return 0; }
0049 #if QT_VERSION_MAJOR == 5
0050 #include "namespaces.qt5.moc_"
0051 #else
0052 #include "namespaces.qt6.moc_"
0053 #endif