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

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.14, dev, 6.2
    • Fix Version/s: 6.2
    • Component/s: Shiboken
    • Labels:
      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

        For Gerrit Dashboard: PYSIDE-1588
        # Subject Branch Project Status CR V

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: