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

Binding generation error if class has a virtual pure method with not bound arguments

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.5.0
    • Shiboken
    • None
    • Linux/X11

      When generating binding with shiboken, if a class has a private virtual pure method which has an argument of type not bound (because I don't want to expose it in Python API), Shiboken doesn't consider this method and so doesn't consider the class abstract and so the generated binding fail at compile time.

      See joined example. If you remove the virtual pure method or define ANotBindedType in typesystem, it works. If not, you'll get the following warning at binding generation

      skipping abstract function 'void AnAbstractClass::apurevirtualmethod(ANotBindedType*)', unmatched type 'ANotBindedType*' in parameter #1 "
      type": Unable to translate type "ANotBindedType*": Cannot find type entry for "ANotBindedType". 
      This will lead to compilation errors due to not being able to instantiate the wrapper.

       

      which indeed, leads to compilation error.

       

      Command lines to generate the binding

      clang++ -I/home/julien/myconf/qt-examples/shiboken_abstract -isystem /usr/local/lib/python3.11/dist-packages/PySide6/include -std=gnu++17 -isystem /home/julien/work/depends/Qt/6.5.0/gcc_64/include/ -I/usr/includ
      e/python3.11 -I/home/julien/work/pyside-setup/install/include/shiboken6 -I/tmp/shiboken_output/core -c /tmp/shiboken_output/core/anabstractclass_wrapper.cpp
      shiboken6 -generator-set=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb_nonzero -std=c++17  -ou
      tput-directory=/tmp/shiboken_output anabstractclass.h typesystem.xml

       

       

        1. anabstractclass.h
          0.2 kB
          Julien Cabieces
        2. globalheader.h
          0.2 kB
          Julien Cabieces
        3. typesystem.xml
          0.2 kB
          Julien Cabieces
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            kleint Friedemann Kleint
            troopa81 Julien Cabieces
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes