aboutsummaryrefslogtreecommitdiffstats
path: root/tests/fully-qualified-moc-types/main.cpp
blob: 3f0859f348f249138d4b997e48edcb17a60f30bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include <QtCore/QObject>

struct A {};

struct NonNamespacedGadget {
    Q_GADGET
};

namespace NS {
    struct MyType {};

    struct NamespacedGadget {
        Q_GADGET
    };

    enum EnumFoo { EnumFoo1 };

    class MyObject : public QObject
    {
        Q_OBJECT
        Q_PROPERTY(NS::MyType foo READ foo) // OK, not gadget
        Q_PROPERTY(MyType foo1 READ foo) // OK, not gadget
        Q_PROPERTY(EnumFoo enumFoo READ enumFoo CONSTANT) // OK
        Q_PROPERTY(NamespacedGadget namespacedGadget READ namespacedGadget CONSTANT) // Warn, gadget
        Q_PROPERTY(NS::NamespacedGadget namespacedGadget2 READ namespacedGadget2 CONSTANT) // OK
        Q_PROPERTY(NonNamespacedGadget nonNamespacedGadget READ nonNamespacedGadget CONSTANT) // OK
    Q_SIGNALS:
        void mysig(NS::MyType);
        void mysig2(MyType); // Warn
        void mysig3(NS::MyType);
        void mysig4(const NS::MyType &);
        void mysig5(A);
        void mysig6(const A);
        void mysig7(const A *);
        void mysig8(A *);
    public Q_SLOTS:
        void myslot1(NS::MyType);
        void myslot2(MyType); // Warn
        void myslot3(NS::MyType);
        void myslot4(const NS::MyType &);
        void myslot5(A);
        void myslot6(const A);
        void myslot7(const A *);
        void myslot8(A *);
    public:
        Q_INVOKABLE void myinvokable1(NS::MyType);
        Q_INVOKABLE void myinvokable2(MyType); // Warn
        Q_INVOKABLE void myinvokable3(NS::MyType);
        Q_INVOKABLE void myinvokable4(const NS::MyType &);
        Q_INVOKABLE void myinvokable5(A);
        Q_INVOKABLE void myinvokable6(const A);
        Q_INVOKABLE void myinvokable7(const A *);
        Q_INVOKABLE void myinvokable8(A *);
        NS::MyType foo();
        NamespacedGadget namespacedGadget() const;
        NamespacedGadget namespacedGadget2() const;
        NonNamespacedGadget nonNamespacedGadget() const;
        EnumFoo enumFoo() const;
    };
}

#include "main.moc_"