diff options
Diffstat (limited to 'tests/auto/tools')
-rw-r--r-- | tests/auto/tools/moc/allmocs_baseline_in.json | 11 | ||||
-rw-r--r-- | tests/auto/tools/moc/grand-parent-gadget-class.h | 3 | ||||
-rw-r--r-- | tests/auto/tools/moc/tst_moc.cpp | 1 |
3 files changed, 14 insertions, 1 deletions
diff --git a/tests/auto/tools/moc/allmocs_baseline_in.json b/tests/auto/tools/moc/allmocs_baseline_in.json index 9f99de65b5..c8abba6a8f 100644 --- a/tests/auto/tools/moc/allmocs_baseline_in.json +++ b/tests/auto/tools/moc/allmocs_baseline_in.json @@ -996,6 +996,17 @@ "name": "Derived" } ] + }, + { + "className": "CRTPDerivedGadget", + "gadget": true, + "qualifiedClassName": "GrandParentGadget::CRTPDerivedGadget", + "superClasses": [ + { + "access": "public", + "name": "CRTP<CRTPDerivedGadget>" + } + ] } ], "inputFile": "grand-parent-gadget-class.h", diff --git a/tests/auto/tools/moc/grand-parent-gadget-class.h b/tests/auto/tools/moc/grand-parent-gadget-class.h index 7ffd636ca1..c7720a1ab9 100644 --- a/tests/auto/tools/moc/grand-parent-gadget-class.h +++ b/tests/auto/tools/moc/grand-parent-gadget-class.h @@ -36,7 +36,8 @@ namespace GrandParentGadget { struct BaseGadget { Q_GADGET }; struct Derived : BaseGadget {}; struct DerivedGadget : Derived { Q_GADGET }; - +template<typename T> struct CRTP : BaseGadget {}; +struct CRTPDerivedGadget : CRTP<CRTPDerivedGadget> { Q_GADGET }; } #endif // GRANDPARENTGADGETCLASS_H diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 36ea101814..e5de647930 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -3813,6 +3813,7 @@ void tst_Moc::gadgetHierarchy() { QCOMPARE(NonGadgetParent::Derived::staticMetaObject.superClass(), static_cast<const QMetaObject*>(nullptr)); QCOMPARE(GrandParentGadget::DerivedGadget::staticMetaObject.superClass(), &GrandParentGadget::BaseGadget::staticMetaObject); + QCOMPARE(GrandParentGadget::CRTPDerivedGadget::staticMetaObject.superClass(), &GrandParentGadget::BaseGadget::staticMetaObject); } void tst_Moc::optionsFileError_data() |