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

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 17 Jan 2018, 10:38 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

    A 1 Reply Last reply 17 Jan 2018, 18:48
    0
    • M MHermann
      17 Jan 2018, 10:38

      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

      A Offline
      A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on 17 Jan 2018, 18:48 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 18 Jan 2018, 06:43 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".

        A 1 Reply Last reply 18 Jan 2018, 07:03
        0
        • M MHermann
          18 Jan 2018, 06:43

          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".

          A Offline
          A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on 18 Jan 2018, 07:03 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 18 Jan 2018, 07:46
          2
          • A aha_1980
            18 Jan 2018, 07:03

            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 18 Jan 2018, 07:46 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

            1/5

            17 Jan 2018, 10:38

            • Login

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