Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-64758

qdbusxml2cpp should avoid to generate cpp language-specific keywords

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P5: Not important
    • None
    • 5.9.1
    • D-Bus
    • None
    • * Fedora 26 64 bit

    Description

      When the XML file contains a methods or properties, called similar to the cpp keywords, e.g. like "Class", then the qdbusxml2cpp generates a files which contains a variable names like "class", that confusing the cpp compiler.

      For example, the input XML file contains following:

          <property name="Class" type="u" access="read"></property>
      

      then the generated output header will be contains following:

          Q_PROPERTY(uint Class READ class)
          inline uint class() const
          { return qvariant_cast< uint >(property("Class")); }
      

      as you can see, there are two keywords "class".  So, resulting property need to change something like to:

          Q_PROPERTY(uint Class READ classProperty)
          inline uint classProperty() const
          { return qvariant_cast< uint >(property("Class")); }
      

      Otherwise it is impossible to use the qmake's features like: DBUS_INTERFACES and DBUS_ADAPTORS.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kuzulis Denis Shienkov
            kuzulis Denis Shienkov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes