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

PySide doesn't handle QList/QVector containers of QSharedPointer types correctly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.5.1
    • 5.15.2, 6.5.0
    • PySide, Shiboken
    • None
    • Linux/X11
    • 17ef62122 (dev), 3965de109 (dev), 293c5d41a (6.5), 583ece6d5 (6.5)

    Description

      Attached minimal example (build it via qmake) based from scriptableapplication.
      I faced strange behavior with signals with pointer and container arguments,
      For testing container and signal arguments, I created an example which has a MyClass (defined in myclass.h) and passed it to different signals with different argument signatures.
      MyClass has been defined in typesystem as object-type

      Signals with raw pointer argument works
      Signals with reference pointer works
      Signals with QList<raw pointer> works
      Signals with QList<MyClass> : signal is received but list is empty (think because its not value-type ?!)
      Signals with QSharedPointer<MyClass> doesn't work
      Signals with QList<QSharedPointer<MyClass>> doesn't work
      Signals with MyClassVector ( alias of QVector<MyClass> ) doesn't work
      Signals with MyClassPtrVector ( alias of QVector<MyClass*> ) doesn't work
      Signals with MyClassVectorPtr ( alias of QVector<MyClass>* ) doesn't work

      here is the output of application after run :
      RawPointer Works <AppLib.MyClass object at 0x7f6a9f1c0ec0>
      Reference Works <AppLib.MyClass object at 0x7f6a9f1c0ec0>
      ListOfRawPointers Works [<AppLib.MyClass object at 0x7f6a9f1c0ec0>, <AppLib.MyClass object at 0x7f6a9f1c0ec0>]
      ListOfItems Works [None]
      TypeError: Can't call meta function because I have no idea how to handle QSharedPointer<MyClass>
      TypeError: Can't call meta function because I have no idea how to handle QList<QSharedPointer<MyClass> >
      TypeError: Can't call meta function because I have no idea how to handle MyClassVector
      TypeError: Can't call meta function because I have no idea how to handle MyClassPtrVector
      TypeError: Can't call meta function because I have no idea how to handle MyClassVectorPtr

      Somewhere in the shiboken's code i see the warnings about typedef inside signal, is it documented anywhere?!
      shiboken is able to generate codes for all test cases ( sig_* signals ) however only 3 of them actually works. Is the support limited for those three basic cases ?!

      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
              a.mosawi ali mosawi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes