QT Remote Objects ENUM, POD
-
Hello all, I am trying to define a remote object interface where I have some slots that have custom defined structs as parameters and those structs can have members that are enumerations. An example .rep file would be:
ENUM MyEnum {FIRST=0, SECOND=1, THIRD=2} POD MyStruct(int i, MyEnum myEnum) class MyClass{ SLOT(slot_mySlot(MyStruct myStruct)) }
I see that in trying to do this the ENUM is generated as a class with the word enum appended to it so to actually use it in the POD I am having to do
POD MyStruct(int i, MyEnumEnum::MyEnum myEnum)
my first question is I wanted to know why this was done this way, instead of the enum just being created as a generic global enum?
Secondly I decided if this is the case I will just define a class to encapsulate all my enumerations so only one class is generated for them, such as:class MyEnumClass{ ENUM MyEnum {{FIRST=0, SECOND=1, THIRD=2} } POD MyStruct(int i, MyEnumClass::MyEnum myEnum) class MyClass{ SLOT(slot_mySlot(MyStruct myStruct)) }
and the issue I am having with this is that the POD calls are resolved before any of the class calls and the struct MyStruct gets placed at the top of the rep_source.h that gets generated which results in the compile error "MyEnumClass was not defined". I was wondering if there is any way to define this .rep file so that I can define a generic class that will hold all enumerations and use that in the POD declaration or if I need to just do my ENUM declarations in the global scope and access them with the
MyEnumEnum::MyEnum
?