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. Give qdbusxml2cpp some options within QtCreator

Give qdbusxml2cpp some options within QtCreator

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 1.4k Views
  • 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.
  • M Offline
    M Offline
    MHermann
    wrote on last edited by
    #1

    Hi!

    I am using qdbusxml2cpp to generate the adaptor and the interface class for dbus.
    I saw there is option "-c" give the name of the class.
    How can I add this option to qdbusxml2cpp in QtCreator?

    Kind regards,
    MHermann

    aha_1980A 1 Reply Last reply
    0
    • M MHermann

      Hi!

      I am using qdbusxml2cpp to generate the adaptor and the interface class for dbus.
      I saw there is option "-c" give the name of the class.
      How can I add this option to qdbusxml2cpp in QtCreator?

      Kind regards,
      MHermann

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi @MHermann:

      How do you call qdbusxml2cpp from Creator?

      Qt has to stay free or it will die.

      1 Reply Last reply
      1
      • M Offline
        M Offline
        MHermann
        wrote on last edited by
        #3

        Hi @aha_1980,

        I am not explicitly calling qdbusxml2cpp.
        I think it is automatically used because of these two lines in the project file:

        DBUS_ADAPTORS += org.example.xml
        DBUS_INTERFACES += org.example.xml
        

        Now I am wondering if it is possible to give some options to this?
        I want to give the class names with the option "-c".

        aha_1980A 1 Reply Last reply
        0
        • M MHermann

          Hi @aha_1980,

          I am not explicitly calling qdbusxml2cpp.
          I think it is automatically used because of these two lines in the project file:

          DBUS_ADAPTORS += org.example.xml
          DBUS_INTERFACES += org.example.xml
          

          Now I am wondering if it is possible to give some options to this?
          I want to give the class names with the option "-c".

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi @MHermann,

          Looks like the comment section in QTBUG-45434 has some hints on this.

          Quoting:

          "
          There are two ways of passing flags to qdbusxml2cpp. One way is to set it for all interfaces and for all adaptors:

          QDBUSXML2CPP_INTERFACE_HEADER_FLAGS
          QDBUSXML2CPP_INTERFACE_SOURCE_FLAGS
          QDBUSXML2CPP_ADAPTOR_HEADER_FLAGS
          QDBUSXML2CPP_ADAPTOR_SOURCE_FLAGS
          

          In case you want to pass different flags for different source XML, you'll want the following instead:

          DBUS_ADAPTORS += chat
          chat.files = org.example.chat.xml
          chat.header_flags = -lFoo
          chat.source_flags = -lFoo
          

          "

          Regards

          Qt has to stay free or it will die.

          M 1 Reply Last reply
          2
          • aha_1980A aha_1980

            Hi @MHermann,

            Looks like the comment section in QTBUG-45434 has some hints on this.

            Quoting:

            "
            There are two ways of passing flags to qdbusxml2cpp. One way is to set it for all interfaces and for all adaptors:

            QDBUSXML2CPP_INTERFACE_HEADER_FLAGS
            QDBUSXML2CPP_INTERFACE_SOURCE_FLAGS
            QDBUSXML2CPP_ADAPTOR_HEADER_FLAGS
            QDBUSXML2CPP_ADAPTOR_SOURCE_FLAGS
            

            In case you want to pass different flags for different source XML, you'll want the following instead:

            DBUS_ADAPTORS += chat
            chat.files = org.example.chat.xml
            chat.header_flags = -lFoo
            chat.source_flags = -lFoo
            

            "

            Regards

            M Offline
            M Offline
            MHermann
            wrote on last edited by MHermann
            #5

            Hi @aha_1980,

            that was exactly the soultion.

            I changed

            DBUS_ADAPTORS += org.example.xml
            

            to

            DBUS_ADAPTORS += dbusAdaptor
            dbusAdaptor.files = org.example.xml
            dbusAdaptor.header_flags = -cdbus_adaptor
            dbusAdaptor.source_flags = -cdbus_adaptor
            

            in the project file.

            So the class name dbus_adaptor is used for the D-Bus adaptor.

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved