#include #include "namespaces.h" // Test that we use the most qualified name in headers namespace Foo { class MyObj2 : public QObject { Q_OBJECT public Q_SLOTS: void separateNSSlot() {}; }; } namespace Foo { class MyObj : public QObject { Q_OBJECT public: public Q_SLOTS: void slot1() {}; void slot2() {}; Q_SIGNALS: void signal1(); }; void foo() { Foo::MyObj *o1 = new Foo::MyObj(); MyObj2 *o2; QObject::connect(o1, &MyObj::signal1, o1, &MyObj::slot1); // Warning QObject::connect(o1, &MyObj::signal1, o2, &MyObj2::separateNSSlot); // Warning } } void foo2() { Foo::MyObj *o1; Foo::MyObj2 *o2; QObject::connect(o1, &Foo::MyObj::signal1, o1, &Foo::MyObj::slot1); // Warning QObject::connect(o1, &Foo::MyObj::signal1, o2, &Foo::MyObj2::separateNSSlot); // Warning } using namespace Foo; // Comes after, so shouldn't have influence int main() { return 0; } #if QT_VERSION_MAJOR == 5 #include "namespaces.qt5.moc_" #elif Q_MOC_OUTPUT_REVISION == 69 #include "namespaces.qt6.moc_69" #else #include "namespaces.qt6.moc_" #endif