Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.13.2
-
None
Description
I have a class with property of type `enum class Foo`
enum class Foo{A, B}; class Bar: public QObject { Q_OBJECT Q_ENUM(Foo) Q_PROPERTY(Foo myCoolProperty READ myCoolProperty WRITE setMyCoolProperty) Foo _foo; public: Bar(); Foo myCoolProperty() const; void setMyCoolProperty(Foo v); };
As far, as I undertand, the problem is in the moc compiler. The flags of myCoolProperty property is not contain isEnumType bit.
For example let's run next code:
Bar *bar = new Bar(); const QMetaObject *m = bar->metaObject(); for(int i=0; i< m->propertyCount(); i++ ) { QMetaProperty mp = m->property(i); qDebug("name=%s, isEnumType=%d %d", mp.name(), mp.isEnumType(), mp.enumerator().isValid() ); }
this produce next output:
name=myCoolProperty, isEnumType=0 0
But `isEnumType` assert =1. And `isValid()` method assert returns 1.
This is because `enum class` types are almost same as `enum`.