diff options
author | Volker Krause <volker.krause@kdab.com> | 2012-09-02 16:30:47 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-09-02 23:41:42 +0200 |
commit | 8c1cb66712a339b09988d8ef2b15ce39678178a6 (patch) | |
tree | 0b3214586a36223c508ffc7b0e1c2eb7dc11e9cf /tests | |
parent | 9d4814e18b9c243340f492f8b7ddd19b523b229f (diff) |
Fix moc generating invalid code for slots with reference types as argument.
We can't have T& declared/registered as a metatype (wont compile), but
using it as type for a slot argument is possible. With the recent
introduction of metatype auto-registration we have to make sure that moc
doesn't attempt to auto-register those. Simple types are handled correctly
already, this fixes containers and smart pointers.
Change-Id: Id96857c57d6ebf158a67e9d527c89dc195473b1b
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/tools/moc/tst_moc.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 795a8307f3..7228daa44a 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -2510,6 +2510,12 @@ public slots: void bu4(CustomObject7, int, CustomObject8) {} void bu5(int, CustomObject9, CustomObject10) {} void bu6(int, CustomObject11, int) {} + + // these can't be registered, but they should at least compile + void ref1(int&) {} + void ref2(QList<int>&) {} + void ref3(CustomQObject2&) {} + void ref4(QSharedPointer<CustomQObject2>&) {} }; void tst_Moc::autoPropertyMetaTypeRegistration() |