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

Shiboken2 includes a private header pysideqmlregistertype.h in "Conversion Includes - Primitive Types".

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • None
    • 5.15.0
    • PySide, Shiboken
    • None
    • Linux/X11
    • b6eaa63a81654459827851a261ad50829cc511ba (pyside/pyside-setup/5.15)

    Description

      This was raised in PYSIDE-845 but died since, perhaps I'm overlooking something.

      I am generating Qt code using qtprotobuf, a fairly simple object with a couple of properties. In the generated cpp file I have call to qmlRegisterType<T>

      Generating PySide2 code using Shiboken2 my global module wrapper header contains:

      // workaround to access protected functions
      #define protected public
      
      #include <sbkconverter.h>
      #include <sbkpython.h>
      // Module Includes
      #include <pyside2_qtcore_python.h>
      #include <pyside2_qtgui_python.h>
      #include <pyside2_qtnetwork_python.h>
      #include <pyside2_qtqml_python.h>
      
      // Bound library includes
      #include <myprotobufheader.qpb.h>
      // Conversion Includes - Primitive Types
      #include "pysideqmlregistertype.h"
      #include <QString>
      #include <QStringList>
      #include <qabstractitemmodel.h>
      #include <signalmanager.h>
      

      The culprit is the pysideqmlregistertype.h include. Which is a private header file from PySide2 sources (pyside-setup/sources/pyside2/PySide2/QtQml/). And even pyside2_qtqml_python.h includes this private header, during cmake build, as expected, I get the errors:

      /usr/local/lib/python3.6/dist-packages/PySide2/include/QtQml/pyside2_qtqml_python.h:83:10: fatal error: pysideqmlregistertype.h: No such file or directory
       #include "pysideqmlregistertype.h"
      

      If I add the source path where the header is located to my target_include_directories it works absolutely fine. I think the person in PYSIDE-845 just copied the file to PySide2/include/QtQml. I am including core and qml typesystems from PySide2

      <load-typesystem name="typesystem_core.xml" generate="no"/>
      <load-typesystem name="typesystem_qml.xml" generate="no"/>
      

      Is this a bug or an error on my side?

       

      Attachments

        Issue Links

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

          Activity

            People

              kleint Friedemann Kleint
              alexmarch Alex March
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes