Warning, file /sdk/clazy/tests/fully-qualified-moc-types/main.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 #include <QtCore/QObject>
0002 
0003 struct A {};
0004 
0005 struct NonNamespacedGadget {
0006     Q_GADGET
0007 };
0008 
0009 namespace NS {
0010     struct MyType {};
0011 
0012     struct NamespacedGadget {
0013         Q_GADGET
0014     };
0015 
0016     enum EnumFoo { EnumFoo1 };
0017 
0018     class MyObject : public QObject
0019     {
0020         Q_OBJECT
0021         Q_PROPERTY(NS::MyType foo READ foo) // OK, not gadget
0022         Q_PROPERTY(MyType foo1 READ foo) // OK, not gadget
0023         Q_PROPERTY(EnumFoo enumFoo READ enumFoo CONSTANT) // OK
0024         Q_PROPERTY(NamespacedGadget namespacedGadget READ namespacedGadget CONSTANT) // Warn, gadget
0025         Q_PROPERTY(NS::NamespacedGadget namespacedGadget2 READ namespacedGadget2 CONSTANT) // OK
0026         Q_PROPERTY(NonNamespacedGadget nonNamespacedGadget READ nonNamespacedGadget CONSTANT) // OK
0027     Q_SIGNALS:
0028         void mysig(NS::MyType);
0029         void mysig2(MyType); // Warn
0030         void mysig3(NS::MyType);
0031         void mysig4(const NS::MyType &);
0032         void mysig5(A);
0033         void mysig6(const A);
0034         void mysig7(const A *);
0035         void mysig8(A *);
0036     public Q_SLOTS:
0037         void myslot1(NS::MyType);
0038         void myslot2(MyType); // Warn
0039         void myslot3(NS::MyType);
0040         void myslot4(const NS::MyType &);
0041         void myslot5(A);
0042         void myslot6(const A);
0043         void myslot7(const A *);
0044         void myslot8(A *);
0045     public:
0046         Q_INVOKABLE void myinvokable1(NS::MyType);
0047         Q_INVOKABLE void myinvokable2(MyType); // Warn
0048         Q_INVOKABLE void myinvokable3(NS::MyType);
0049         Q_INVOKABLE void myinvokable4(const NS::MyType &);
0050         Q_INVOKABLE void myinvokable5(A);
0051         Q_INVOKABLE void myinvokable6(const A);
0052         Q_INVOKABLE void myinvokable7(const A *);
0053         Q_INVOKABLE void myinvokable8(A *);
0054         Q_INVOKABLE MyType* myinvokable9(NS::MyType); // Warn
0055         NS::MyType foo();
0056         NamespacedGadget namespacedGadget() const;
0057         NamespacedGadget namespacedGadget2() const;
0058         NonNamespacedGadget nonNamespacedGadget() const;
0059         EnumFoo enumFoo() const;
0060     };
0061 }
0062 
0063 
0064 
0065 namespace { // annonymous
0066     struct AnnonFoo {};
0067 };
0068 
0069 class MyObj2 : public QObject
0070 {
0071 Q_SIGNALS:
0072     void mySig(AnnonFoo);
0073 };
0074 
0075 
0076 #include "main.moc_"