Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. qdbus

    Log in to post
    • All categories
    • C

      Unsolved QDBus path encoding
      General and Desktop • qdbus • • Chruetli

      4
      0
      Votes
      4
      Posts
      198
      Views

      C

      Thank you for the answer. Honestly I expected this as some kind of magic done in background...
      At the moment I will use the sd_bus_path_encode function.
      The source of the function can be found at https://github.com/systemd/systemd/blob/main/src/basic/bus-label.c called bus_label_escape.

    • F

      Unsolved qdbusreply: unexpected reply signature?
      General and Desktop • dbus qdbus signature error • • flodo

      2
      0
      Votes
      2
      Posts
      271
      Views

      F

      You have to register the expected Response first!

      In my case it was like

      #include <QtDBus/QDBusMetaType> // ... typedef QMap<QString, QMap<QString, QVariant> > ConnectionDetails; Q_DECLARE_METATYPE(ConnectionDetails)

      and

      int main() { qDBusRegisterMetaType<ConnectionDetails>(); // ... }
    • swirl

      Unsolved Receiving system D-Bus signals and responding to them
      General and Desktop • dbus qdbus • • swirl

      1
      0
      Votes
      1
      Posts
      205
      Views

      No one has replied

    • C

      Solved Cannot receive response from DBus
      General and Desktop • qdbus dbus • • Crindu

      3
      0
      Votes
      3
      Posts
      596
      Views

      C

      @SGaist You're right,I did not think about it! I have to remove the systemBus, I'm not using it in reality, it's part of the project that I found on Github. Ok then I can try to make it an instance variable of the class or similer. Thank you!

    • M

      Unsolved QDbus list names under a specific path
      General and Desktop • qdbus list path service interface • • Mark81

      2
      0
      Votes
      2
      Posts
      1075
      Views

      M

      @Mark81 ok, I found a way:

      QDBusInterface *iface = new QDBusInterface("your.service", "/your/path", "org.freedesktop.DBus.Introspectable", QDBusConnection::systemBus(), this); qDebug() << iface->call("Introspect").arguments();
    • M

      Unsolved QDBus: how to retreive object path
      General and Desktop • qdbus object path avrcp • • Mark81

      2
      0
      Votes
      2
      Posts
      965
      Views

      kshegunov

      @Mark81
      Hi,

      I'm not sure if it is returned from some DBus methods or I have to manually build it using the bluetooth address and the local device.

      It is not, you have to handle it manually. From what I can discern from your link it's a path you construct out of device names. If the service is compliant you can usually list the objects it exposes.

      Kind regards.

    • spyd3r

      Unsolved Unknown Object Path even after registering object in QDbus
      General and Desktop • qt 5.5 qdbus • • spyd3r

      1
      0
      Votes
      1
      Posts
      1391
      Views

      No one has replied

    • wenzel

      Unsolved Signal not emitted over QDbus
      General and Desktop • qdbus signal&slot • • wenzel

      1
      0
      Votes
      1
      Posts
      782
      Views

      No one has replied

    • Matthew Vick

      Unsolved qdbusxml2cpp Annotations and Supported Types
      General and Desktop • qdbus • • Matthew Vick

      2
      0
      Votes
      2
      Posts
      1415
      Views

      SGaist

      Hi and welcome to devnet,

      Since it might need some knowledge of the internals of QtDBus, I'd recommend posting this question on the interest mailing list You'll find there Qt's developers/maintainers (this forum is more user oriented)

    • S

      QDBus - SLOT not called upon SIGNAL emit
      General and Desktop • qdbus qt5.4.0 signal & slot • • ShayPrat

      1
      0
      Votes
      1
      Posts
      744
      Views

      No one has replied

    • S

      DBus method calls with arguments
      General and Desktop • qdbus linux • • StMartin81

      2
      1
      Votes
      2
      Posts
      5171
      Views

      S

      I got it working. Problem was that instead of bool I had to use QVariant of QDBusVariant type. So the two functions look like this now:

      These are the defines I've used:

      #define BLUEZ_DBUS_SERVICE "org.bluez" #define BLUEZ_DBUS_PATH "/org/bluez/hci0" #define BLUEZ_DBUS_IF "org.bluez.Adapter1"

      And here is the first implementationÖ

      QDBusConnection bus = QDBusConnection::systemBus(); if (!bus.isConnected()) { qFatal("Cannot connect to the D-Bus session bus."); return; } QDBusMessage message = QDBusMessage::createMethodCall(BLUEZ_DBUS_SERVICE, BLUEZ_DBUS_PATH, "org.freedesktop.DBus.Properties", "Set"); QList<QVariant> arguments; arguments << BLUEZ_DBUS_IF << "Powered" << QVariant::fromValue(QDBusVariant(true)); message.setArguments(arguments); QDBusPendingReply<QVariantMap> reply = bus.asyncCall(message); reply.waitForFinished();

      and here is the second possibility to implement the method call:

      QDBusConnection bus = QDBusConnection::systemBus(); if (!bus.isConnected()) { qFatal("Cannot connect to the D-Bus session bus."); return; } QDBusInterface dbus_iface(BLUEZ_DBUS_SERVICE, BLUEZ_DBUS_PATH, "org.freedesktop.DBus.Properties", bus); if ( dbus_iface.isValid() ) { QDBusPendingReply<QVariantMap> reply = dbus_iface.asyncCall("Set", BLUEZ_DBUS_IF, "Powered", QVariant::fromValue(QDBusVariant(true))); reply.waitForFinished(); reply.error().message(); }

      In case anybody wants to do the same thing there is also the possibility to set the "Powered" property directly:

      QDBusInterface ifc( BLUEZ_DBUS_SERVICE, BLUEZ_DBUS_PATH, BLUEZ_DBUS_IF, QDBusConnection::systemBus()); if ( ifc.isValid() ) { ifc.setProperty("Powered", true); }