Results 1 to 9 of 9

Thread: Marshaling classes with QtDBus

  1. #1
    Join Date
    Nov 2007
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Marshaling classes with QtDBus

    Hi, this is my first post here.
    Sorry if my english is too bad.

    I've write an xml interface for DBus, and it working perfectly when I use a primitive type or a Qt predefined signature (some as "as" or "s").

    Because I want to use some object not defined by Qt4 I've implemented a new class, I've register it with Q_DECLARE_METATYPE, qRegisterMetaType and qDBusRegisterMetaType, so I've overloaded the operator << and >> for QDBusArgument and my type.
    I've change the signature in the xml and I've insert an annotation (for qdbusxml2cpp) like this:

    Qt Code:
    1. <annotation name="com.trolltech.QtDBus.QtTypeName.Out0"
    2. value="DBusReturn"/>
    To copy to clipboard, switch view to plain text mode 

    DBusReturn is my object

    So, if I execute qdbusviewer and call the function I have an error message saying that the function don't exist.

    I've think that this is a problem of qdbusviewer, that don't manage the strange signature, so I have change this one with a signature recognized from the Qts.
    So, qdbusviewer work, but the result is empty. So I've write some qDebug in the << and >> operators and in the callback function, but that don't write anything.

    I've try the code called in the adaptor in another place, and all work.

    I've Qt 4.3.2. If you want to see some code it isn't a problem (the project is under GPL2 but the code of the last 2 days isn't online becouse don't working).

    Thanks

    EDIT:

    Sorry, double thread!
    Last edited by Yota_VGA; 21st November 2007 at 01:46. Reason: Double threading

  2. #2
    Join Date
    Jul 2007
    Posts
    121
    Thanks
    38
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Marshaling classes with QtDBus

    I can't help with QtDBus, but I am curious - are you using it on Linux or on Windows? My understanding that it is only available on Linux, but it will be a great joy to find out that I am wrong.

    Also, does anyone know what is in store for QtDBus in next Qt releases?

  3. #3
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    491
    Thanked 73 Times in 69 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Marshaling classes with QtDBus

    Quote Originally Posted by MichaelB View Post
    My understanding that it is only available on Linux, but it will be a great joy to find out that I am wrong.
    Then take a look at windows.kde.org

  4. #4
    Join Date
    Nov 2007
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Marshaling classes with QtDBus

    I use GNU/Linux, actually QtDBus working officially only on *nix, but the kde team has build an unofficial porting for windows.
    I think that in a near future this will become official, but I'm not sure

  5. #5
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    491
    Thanked 73 Times in 69 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Marshaling classes with QtDBus

    I wonder what you mean with 'unofficial' - it's open source and available for everyone...

  6. #6
    Join Date
    Nov 2007
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Marshaling classes with QtDBus

    I want to say that it isn't trolltech and it isn't present in the trolltech Qt release

  7. #7
    Join Date
    Jul 2007
    Posts
    121
    Thanks
    38
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Marshaling classes with QtDBus

    ChristianEhrlicher,

    Thank you for the response. While trying to locate the project with googling <DBus KDE windows> I quickly located your post regarding DBus
    http://www.nabble.com/Problem-with-d...-t4686135.html

    , but I failed to find out DBus/windows project root. I will really appreciate it if you can point me to the place where this project is located. Also, it looks like you have an experience working with DBus on windows - may be you can share your opinion/experience/pitfalls with using it?

  8. #8
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    491
    Thanked 73 Times in 69 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Marshaling classes with QtDBus

    The project is located on sourceforge: http://sourceforge.net/projects/windbus

    Binary packages are also available -> use the kdewin-installer to get them (0.8.3-1 is the recent release atm)

  9. The following user says thank you to ChristianEhrlicher for this useful post:

    QPlace (21st November 2007)

  10. #9
    Join Date
    Nov 2007
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Marshaling classes with QtDBus

    Ok, this is a problem of qdbusviewer. I've try to access on my dbus server with a simply python script (with pyqt and dbus modules) and all work perfectly.

    So qdbusviewer is usefull only with very simple dbus interfaces. I can use python for tests but it is a wasteful amount of time. What I can use for a fast debug of a complex dbus interface?

    EDIT:

    Uhm, I've tested well all the things and don't generate any error, but the results are totally incorrect.

    EDIT:

    I'm sorry, I've commit some mistakes in my test, all OK
    Last edited by Yota_VGA; 22nd November 2007 at 01:24. Reason: More (more) depth tests ;)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.