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

Shared pointer convertible to base class ONLY if directly inherits the base class

    XMLWordPrintable

    Details

    • Commits:
      ee47ccbd9a (pyside/pyside-setup/dev) ee47ccbd9a (pyside/tqtc-pyside-setup/dev) 5eb9535b70 (pyside/tqtc-pyside-setup/5.15) 1cc547a413 (pyside/pyside-setup/6.3) 1cc547a413 (pyside/tqtc-pyside-setup/6.3) eb62049589 (pyside/tqtc-pyside-setup/6.2)

      Description

      A Function which takes QSharedPointer<BaseClass> as an argument, only classes which directly inherit BaseClass seem to be properly converted.

      So in a nutshell:

      class ClassA : public BaseClass {}; //This would be properly converted
      
      class ClassB : public ClassA {}; //This would NOT be properly converted
      

      pointer to ClassA could be passed into the function successfully but pointer to ClassB would result in an error.

      Steps to reproduce the problem:

      • Build the attached project
        • cmake --build <path_to_src> -DCMAKE_PREFIX_PATH=<path_to_qt>
        • cmake --install <build_dir>
      • Run the main.py

       

      NOTE: this can be reproduced with 5.15.9 as well but the version can't be selected.

       

        Attachments

        1. pyside1933_2.zip
          16 kB
        2. pyside1933_6.zip
          16 kB
        3. pyside1933.zip
          11 kB

          Issue Links

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

            Activity

              People

              Assignee:
              kleint Friedemann Kleint
              Reporter:
              miikapernu Miika Pernu
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: