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. QObjects and QtDBus
Forum Updated to NodeBB v4.3 + New Features

QObjects and QtDBus

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 501 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.
  • R Offline
    R Offline
    RolandWinklmeier
    wrote on last edited by
    #1

    Hey there,

    I have a question and I hope you can help me out.

    I have an application with a QML UI with different list views etc.
    Lets say I have a list of people who are online in a network, I have a class CFoo, which returns me a specific Person.

    @
    CPerson {
    CPerson();
    QString getName();
    int getAge();
    }

    class CFoo {
    Q_PROPERTY(CPerson person READ getPerson NOTIFY personChanged)
    public:
    const CPerson> & getPerson();

    Q_SIGNAL:
    void personChanged();
    }
    @

    I need to register CFoo in the QML context to call its member. But I also have to register CPerson in the QML context, so it has to subclass QObject, otherwise I can't access its getters.

    On the other hand I need to expose CFoo to a DBus session. But is it somehow possible to use a class with QObject as base class as an argument in a DBus message?

    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