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. Pass DBus method call an array
Qt 6.11 is out! See what's new in the release blog

Pass DBus method call an array

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.1k Views 1 Watching
  • 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.
  • I Offline
    I Offline
    Iktwo
    wrote on last edited by
    #1

    Hi, I can't pass an array to a QDBusMessage

    I tried
    @
    uchar a[1] = {0};
    msg << a;
    @

    But I get a "QVariant::QVariant(void *) is private" error

    I've also tried
    @QDBusArgument *arg=new QDBusArgument();
    arg->beginArray();
    arg->appendVariant(0);
    arg->endArray();

    msg << arg;
    @

    But I get the same error.

    Thanks!

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      operator<< of QDBusMessage takes a QVariant as argument. There's no implicit conversion between an array of uchar and QVariant, that's why the compiler bails out. You will have to create a QVariant with the contents of your array.

      http://www.catb.org/~esr/faqs/smart-questions.html

      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