Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1588

Some Changes in XML are not Visible in Python Interface Files

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 6.2.0
    • 5.14, 6.2.9
    • Shiboken
    • None

    Description

      When certain changes to the XML of generated classes are made, these changes are performed internally, but the change is not visible in the generated code comments and, more importantly, not in the generated .pyi files.

      Example:

      We modify a function from QFile like so:

        <object-type name="QFile">
          <!-- PYSIDE-1499: Replace QString by pathlib.Path (qfile.h) -->
          <modify-function signature="QFile(const QString &amp;)" return-type="PyObject*">
              <modify-argument index="1"><replace-type modified-type="PyPathLike"/></modify-argument>
              <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qfile-path-1"/>
          </modify-function>
      

      This has the desired effect to use PyPathLike instead of QString, but we can see the effect of this change nowhere.
      As a workaround, we also added the function, giving

        <object-type name="QFile">
          <!-- PYSIDE-1499: Replace QString by pathlib.Path (qfile.h) -->
          <modify-function signature="QFile(const QString &amp;)" return-type="PyObject*">
              <modify-argument index="1"><replace-type modified-type="PyPathLike"/></modify-argument>
              <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qfile-path-1"/>
          </modify-function>
          <add-function signature="QFile(const PyPathLike &amp;@name@)"/>
      

      This has the effect that additionally a new type is added, with the only purpose to show up in the signature, because the functionality is already covered by the modify-function.

      It would be very nice to avoid this hackish workaround.

      Attachments

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

        Activity

          People

            kleint Friedemann Kleint
            ctismer Christian Tismer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: