Results 1 to 13 of 13

Thread: Retriving structure in qt-urgent.please reply.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2007
    Posts
    55
    Thanks
    1
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Retriving structure in qt-urgent.please reply.

    As a Windows programmer, I am not in DBUS, but what you have to do is mentioned in the part "The QtDBus Type System | Extending the type system" and "QDBusArgument Class Reference" of the documentation:
    1. declare your structure as a Qt meta-type (Q_DECLARE_METATYPE)
    2. reimplement the streaming operators << and >>
    3. in your programm, you should register (qDBusRegisterMetaType()) your datatype

    Concerning the char array issue, you could use a QString or send the chars one by one, surely not elegant but it could work...

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Retriving structure in qt-urgent.please reply.

    Quote Originally Posted by alainstgt View Post
    Concerning the char array issue, you could use a QString or send the chars one by one, surely not elegant but it could work...
    As I understand it the point is those chars are not actually chars but pointers to pointers to integers (or something like that, it's hard to understand the OP). Otherwise I don't see what the problem is, as I said the docs for QDBusArgument contain a nice example of dealing with structures.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    May 2010
    Posts
    100
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Retriving structure in qt-urgent.please reply.

    As i said its not in my hand to change the structure. I will get only refrence to it,and need to convert it into a string.



    In another method i am passing a structure from nonqt application. And its signature shown is '(suu)',means structure consisting of "string,unsiged int,unsigned int." . But,i cant register a method from qt which can accept a method call like this.Even with qdbusviewer cant do this.

    And if i do

    1. declare your structure as a Qt meta-type (Q_DECLARE_METATYPE)
    2. reimplement the streaming operators << and >>
    3. in your programm, you should register (qDBusRegisterMetaType()) your datatype

    than there will not be a method which can have the foo(string,unsiged int,unsigned int.) method.

Similar Threads

  1. howto send a reply using QDBusMessage
    By HERC in forum Qt Programming
    Replies: 2
    Last Post: 23rd February 2010, 16:32
  2. [URGENT] Weird compile error [URGENT]
    By MarkoSan in forum Qt Programming
    Replies: 3
    Last Post: 24th May 2008, 23:54

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.