Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QT Remote Objects ENUM, POD
Forum Updated to NodeBB v4.3 + New Features

QT Remote Objects ENUM, POD

Scheduled Pinned Locked Moved Unsolved General and Desktop
remoteobjectsenums
1 Posts 1 Posters 347 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sevimo
    wrote on 18 May 2023, 17:03 last edited by
    #1

    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
    

    ?

    1 Reply Last reply
    0

    1/1

    18 May 2023, 17:03

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved