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

Segmentation fault on QGraphicsLineItem and QObject hybrid using super()



    • Type: Bug
    • Status: Open
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.11.0, 5.11.1
    • Fix Version/s: None
    • Component/s: PySide, Shiboken
    • Labels:
    • Environment:
      Python 3.6.5 via Anaconda on Kubuntu 18.04
    • Platform/s:


      I get a segmentation fault when I try to emit a signal on a class that inherts from both QGraphicsLineItem and QObject, when I use the Python 3 feature super() to call the parent class init methods. If I instantiate each parent by directly calling their init method, the code works as intended.

      The reason for inheriting from QObject is to add signal and slot capabilities to the QGraphicsLineItem.

      The attached examples show the two scenarios above. In both cases, a QGraphicsScene is displayed, and when clicked with the mouse the QGraphicsLineItem/QObject hybrid object is added. In the first case, the init method contains the call super(), which should use method resolution order to call each parent constructor in turn, automatically. In the second case, I explicitly call the parent constructors. The segmentation fault occurs in the first case.

      The exact error message I see is "Segmentation fault (core dumped)". There is no other information.


        1. pyside800_stack.txt
          40 kB
        2. pyside800.py
          2 kB
        3. qt1.py
          2 kB
        4. qt2.py
          2 kB
        For Gerrit Dashboard: PYSIDE-800
        # Subject Branch Project Status CR V



            • Assignee:
              crmaurei Cristian Maureira-Fredes
              ssl ssl
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created:

                Gerrit Reviews

                There are no open Gerrit changes