diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-11-17 11:51:16 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-11-30 14:58:31 (GMT) |
commit | b881d8fb99972f1bd04ab4c84843cc8d43ddbeed (patch) | |
tree | f415bc8c76ecc388d05f940a02e2c863dc96f111 /tests/auto/qobject/oldnormalizeobject.h | |
parent | f3ac20ac8100142cde0accfb72eab48590303c4a (diff) | |
download | Qt-b881d8fb99972f1bd04ab4c84843cc8d43ddbeed.zip Qt-b881d8fb99972f1bd04ab4c84843cc8d43ddbeed.tar.gz Qt-b881d8fb99972f1bd04ab4c84843cc8d43ddbeed.tar.bz2 |
Fix certain type-const-ref syntax not recognized by normalizedSignature()
Normally, const Type & is normalized to just Type, but this didn't
work for Template<T>const& or Type*const& types. This now works as
expected.
However, this changes the way these types are normalized, and existing
code using the old syntax will break. We can prevent this breakage by
also normalizing the method signature in the metaobject when looking
up signals and slots in QObject::connect(). I have added an autotest
for this, which includes moc output generated by Qt 4.6's moc. This
means we need to bump the metaobject revision number even though we
are not adding any new data (only changing the normalized strings we
store).
Task-number: QTBUG-2407
Task-number: QTBUG-3722
Reviewed-by: ogoffart
Diffstat (limited to 'tests/auto/qobject/oldnormalizeobject.h')
-rw-r--r-- | tests/auto/qobject/oldnormalizeobject.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/qobject/oldnormalizeobject.h b/tests/auto/qobject/oldnormalizeobject.h new file mode 100644 index 0000000..8420a3a --- /dev/null +++ b/tests/auto/qobject/oldnormalizeobject.h @@ -0,0 +1,28 @@ +#ifndef OLDNORMALIZEOBJECT_H +#define OLDNORMALIZEOBJECT_H + +#include <QObject> + +struct Struct; +class Class; +template <typename T> class Template; + +// An object with old moc output that incorrectly normalizes 'T<C> const &' in the function +// signatures +class OldNormalizeObject : public QObject +{ + /* tmake ignore Q_OBJECT */ + Q_OBJECT + +signals: + void typeRefSignal(Template<Class &> &ref); + void constTypeRefSignal(const Template<const Class &> &ref); + void typeConstRefSignal(Template<Class const &> const &ref); + +public slots: + void typeRefSlot(Template<Class &> &) {} + void constTypeRefSlot(const Template<const Class &> &) {} + void typeConstRefSlot(Template<Class const &> const &) {} +}; + +#endif // OLDNORMALIZEOBJECT_H |