Warning, file /sdk/clazy/tests/ctor-missing-parent-argument/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 #include <QtWidgets/QWidget>
0003 
0004 class Test : public QObject // Warn
0005 {
0006 public:
0007     Test();
0008 };
0009 
0010 class Test2 : public Test // Warn
0011 {
0012 public:
0013     Test2();
0014 };
0015 
0016 class Test3 // OK
0017 {
0018 public:
0019     Test3();
0020 };
0021 
0022 class Test4 : public Test // OK
0023 {
0024 public:
0025     Test4();
0026     Test4(QObject*); //  Not common, but lets not warn
0027 };
0028 
0029 class Test5 : public Test // Warn
0030 {
0031 public:
0032     Test5(const QObject*);
0033 };
0034 
0035 class QObject; // OK
0036 
0037 class WTest : public QWidget
0038 {
0039 public:
0040     WTest(QWidget *); // OK
0041 };
0042 
0043 class WTest2 : public QWidget
0044 {
0045 public:
0046     WTest2(QObject *); // Warn
0047 };
0048 
0049 namespace Qt3DCore {
0050     class QNode : public QObject { QNode(); };
0051     // This is just a dummy so we don't have to depend on Qt3D
0052     class QEntity : public QNode // clazy:exclude=ctor-missing-parent-argument
0053     {
0054     };
0055 }
0056 
0057 struct MyEntity : Qt3DCore::QEntity // Warn
0058 {
0059     MyEntity();
0060 };
0061 
0062 struct MyEntity2 : Qt3DCore::QEntity { // OK
0063     MyEntity2(Qt3DCore::QNode*);
0064 };
0065 
0066 namespace Qt3DCore
0067 {
0068     struct MyEntity3 : QEntity { // OK
0069     MyEntity3(QNode*);
0070 };
0071 }
0072 
0073 class Test6 : public QObject // OK
0074 {
0075 public:
0076 };
0077 
0078 #include <QtCore/QCoreApplication>
0079 class MyApplication : public QCoreApplication
0080 {
0081 public:
0082     MyApplication(int a, char **b) : QCoreApplication(a, b) {} // OK. Bug 384926
0083 };