diff options
author | Matthew Vogt <matthew.vogt@nokia.com> | 2012-06-22 15:32:46 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-27 02:28:40 +0200 |
commit | a93c2608d69fa385c675a6b49e4d4bfb97f83ed2 (patch) | |
tree | 88b9bc5b459600d85c6519995367669396787568 /tests/auto/qml/qqmllanguage/testtypes.h | |
parent | a2aa4705702256c15aaaf64e08b90c4749233f9d (diff) |
Add enum values from related types
If moc marks a type as being related to another type (by using that
type's enums or properties), then include the enum values exported
by the related type in those exposed by the dependent type.
Task-number: QTBUG-22675
Change-Id: I78e72791a4f470200a9ba986a865ffac6c873725
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'tests/auto/qml/qqmllanguage/testtypes.h')
-rw-r--r-- | tests/auto/qml/qqmllanguage/testtypes.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/testtypes.h b/tests/auto/qml/qqmllanguage/testtypes.h index 50b6089ffc..01f26c7f67 100644 --- a/tests/auto/qml/qqmllanguage/testtypes.h +++ b/tests/auto/qml/qqmllanguage/testtypes.h @@ -205,11 +205,21 @@ private: }; +class MyEnumContainer : public QObject +{ + Q_OBJECT + Q_ENUMS(RelatedEnum) + +public: + enum RelatedEnum { RelatedInvalid = -1, RelatedValue = 42 }; +}; + class MyTypeObject : public QObject { Q_OBJECT Q_ENUMS(MyEnum) Q_ENUMS(MyMirroredEnum) + Q_ENUMS(MyEnumContainer::RelatedEnum) Q_FLAGS(MyFlags) Q_PROPERTY(QString id READ id WRITE setId) @@ -220,6 +230,7 @@ class MyTypeObject : public QObject Q_PROPERTY(MyEnum readOnlyEnumProperty READ readOnlyEnumProperty) Q_PROPERTY(Qt::TextFormat qtEnumProperty READ qtEnumProperty WRITE setQtEnumProperty NOTIFY qtEnumPropertyChanged) Q_PROPERTY(MyMirroredEnum mirroredEnumProperty READ mirroredEnumProperty WRITE setMirroredEnumProperty NOTIFY mirroredEnumPropertyChanged) + Q_PROPERTY(MyEnumContainer::RelatedEnum relatedEnumProperty READ relatedEnumProperty WRITE setRelatedEnumProperty) Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty NOTIFY stringPropertyChanged) Q_PROPERTY(uint uintProperty READ uintProperty WRITE setUintProperty NOTIFY uintPropertyChanged) Q_PROPERTY(int intProperty READ intProperty WRITE setIntProperty NOTIFY intPropertyChanged) @@ -323,6 +334,14 @@ public: emit mirroredEnumPropertyChanged(); } + MyEnumContainer::RelatedEnum relatedEnumPropertyValue; + MyEnumContainer::RelatedEnum relatedEnumProperty() const { + return relatedEnumPropertyValue; + } + void setRelatedEnumProperty(MyEnumContainer::RelatedEnum v) { + relatedEnumPropertyValue = v; + } + QString stringPropertyValue; QString stringProperty() const { return stringPropertyValue; |