diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2010-03-25 19:05:35 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2010-03-26 11:25:13 (GMT) |
commit | df0e6759e8ebc1053f951d3a5398a41156e91913 (patch) | |
tree | 18396f0e4763f37ada5acc3b6f60fd151d26fbaf /tests/auto/qobject | |
parent | e7eb7bdf63791ed03257f2f23b1f515e4d89e054 (diff) | |
download | Qt-df0e6759e8ebc1053f951d3a5398a41156e91913.zip Qt-df0e6759e8ebc1053f951d3a5398a41156e91913.tar.gz Qt-df0e6759e8ebc1053f951d3a5398a41156e91913.tar.bz2 |
QMetaObject::normalizeType: fix uses of const and template.
'const' was not removed from templated class
This even fixes compilation errors if using const return templated types
We can change the normalized signature in Qt 4.7 as it has already changed
and we have code to check that if moc revision < 5 it will
renormalize all the symbols
cf commit b881d8fb99972f1bd04ab4c84843cc8d43ddbeed
Task-number: QTBUG-7421
Reviewed-by: Brad
Reviewed-by: Kent Hansen
Diffstat (limited to 'tests/auto/qobject')
-rw-r--r-- | tests/auto/qobject/tst_qobject.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qobject/tst_qobject.cpp b/tests/auto/qobject/tst_qobject.cpp index 8da3484..08b7c19 100644 --- a/tests/auto/qobject/tst_qobject.cpp +++ b/tests/auto/qobject/tst_qobject.cpp @@ -2088,6 +2088,9 @@ signals: void typePointerConstRefSignal(Class * const &); + void constTemplateSignal1( Template<int > ); + void constTemplateSignal2( Template< const int >); + public slots: void uintPointerSlot(uint *) { } void ulongPointerSlot(ulong *) { } @@ -2124,6 +2127,10 @@ public slots: void typeConstRefSlot(Template<Class const &> const &) {} void typePointerConstRefSlot(Class * const &) {} + + void constTemplateSlot1(Template<int > const) {} + void constTemplateSlot2(const Template<int > ) {} + void constTemplateSlot3(const Template< const int >) {} }; #include "oldnormalizeobject.h" @@ -2526,6 +2533,19 @@ void tst_QObject::normalize() QVERIFY(object.connect(&object, SIGNAL(typePointerConstRefSignal(Class*)), SLOT(typePointerConstRefSlot(Class*)))); + + QVERIFY( connect(&object, SIGNAL(constTemplateSignal1(Template <int>)), + &object , SLOT(constTemplateSlot1 (Template<int > ) ) )); + QVERIFY( connect(&object, SIGNAL(constTemplateSignal1(Template <int>)), + &object , SLOT(constTemplateSlot2 (Template<int > ) ) )); + QVERIFY( connect(&object, SIGNAL(constTemplateSignal2(Template <const int>)), + &object , SLOT(constTemplateSlot3(Template<int const > ) ) )); + + //type does not match + QTest::ignoreMessage(QtWarningMsg, "QObject::connect: Incompatible sender/receiver arguments\n" + " NormalizeObject::constTemplateSignal1(Template<int>) --> NormalizeObject::constTemplateSlot3(Template<const int>)"); + QVERIFY(!connect(&object, SIGNAL(constTemplateSignal1(Template <int>)), + &object , SLOT(constTemplateSlot3(Template<int const> ) ) )); } class SiblingDeleter : public QObject |