Details
-
Suggestion
-
Resolution: Unresolved
-
P4: Low
-
None
-
5.5.0
-
None
Description
Currently if you create a property as:
Q_PROPERTY(int test MEMBER testStruct.testNotWorking) struct testStruct_t{ int testNotWorking; } testStruct_t testStruct; int testWorking;
moc indicates a parse error at "testStruct"
generated code by MOC if i access testWorking instead is:
else if (_c == QMetaObject::ReadProperty) { MyItem *_t = static_cast<MyItem *>(_o); Q_UNUSED(_t) void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< int*>(_v) = _t->testWorking; break; default: break; } } else if (_c == QMetaObject::WriteProperty) { MyItem *_t = static_cast<MyItem *>(_o); Q_UNUSED(_t) void *_v = _a[0]; switch (_id) { case 0: if (_t->testWorking != *reinterpret_cast< int*>(_v)) { _t->testWorking = *reinterpret_cast< int*>(_v); } break; default: break; }
i think it must allow to access a struct/class, C++ compiler will give the error if the member is private, but i don't see why it should be forbidden at parse level.
But it would allow to pack properties together on a standard layout