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. sending QMap<enum, QString> over Qt DBus
Forum Updated to NodeBB v4.3 + New Features

sending QMap<enum, QString> over Qt DBus

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 425 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.
  • V Offline
    V Offline
    Venkateswaran
    wrote on last edited by
    #1

    I Tried to send QMap<enumType, QString> over Qt DBus but I'm getting below error.

    QDBusMarshaller: type 'test::TEST_ENUM' (1026) cannot be used as the key type in a D-BUS map.
    QDBusMarshaller: type `QMap<test::TEST_ENUM',QString>' produces invalid D-BUS signature `<empty>' (Did you forget to call beginStructure() ?)
    QDBusMarshaller::appendVariantInternal: Found unknown D-BUS type ''
    QDBusMarshaller::appendVariantInternal: Found unknown D-BUS type ''
    

    TEST_ENUM is my enum type defined under test namespace.
    I registered both the enum type and QMap with qDBusRegisterMetaType.

    In header file

    using testMap = QMap<TEST_ENUM, QString>;
    Q_DECLARE_METATYPE(test::TEST_ENUM)
    

    In CPP file

    defined operator<< & operator>> for test::TEST_ENUM
    
    qDBusRegisterMetaType<test::TEST_ENUM>();
    qRegisterMetaType<test::TEST_ENUM>("test::TEST_ENUM");
    qDBusRegisterMetaType<test::testMap>();
    
    1 Reply Last reply
    0

    • Login

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