diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-05-15 17:11:57 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-05-16 09:36:08 +0000 |
commit | a66352996264d7dfbbe68df179421a8e0ef3637a (patch) | |
tree | 1e33d85992e42fe68caed5be2df60365ddac650c /sources/shiboken2/tests/libsample | |
parent | 15273fe0fe52569013dd4811bf9ed770ce7fb287 (diff) |
Fix wrongly generated code for enums passed by const-ref
First encountered in:
QtScxmlEvent::setEventType(const EventType &);
The metatype was wrongly detected as NativePointerPattern
in AbstractMetaType::determineUsagePattern().
Introduce a helper for detecting plain const-ref and use
that consistently.
Change-Id: I6b105bc99ae63e4737c5d628e79f23b7acbcca3d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2/tests/libsample')
-rw-r--r-- | sources/shiboken2/tests/libsample/objecttype.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sources/shiboken2/tests/libsample/objecttype.h b/sources/shiboken2/tests/libsample/objecttype.h index 9d659faa4..bcb4f3332 100644 --- a/sources/shiboken2/tests/libsample/objecttype.h +++ b/sources/shiboken2/tests/libsample/objecttype.h @@ -53,6 +53,10 @@ struct Event Event(EventType eventType) : m_eventType(eventType) {} EventType eventType() { return m_eventType; } + + void setEventType(EventType et) { m_eventType = et; } + void setEventTypeByConstRef(const EventType &et) { m_eventType = et; } + private: EventType m_eventType; }; |