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

Segmentation fault on QGraphicsLineItem and QObject hybrid using super()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 5.12.0
    • 5.11.0, 5.11.1
    • PySide, Shiboken
    • None
    • Python 3.6.5 via Anaconda on Kubuntu 18.04
    • All
    • b89c4b2f0d5eba7167112cc4d9ab1137b6922ebb

    Description

      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.

      Attachments

        1. pyside800_stack.txt
          40 kB
        2. pyside800.py
          3 kB
        3. qt1.py
          2 kB
        4. qt2.py
          2 kB

        Issue Links

          For Gerrit Dashboard: PYSIDE-800
          # Subject Branch Project Status CR V

          Activity

            People

              crmaurei Cristian Maureira-Fredes
              ssl ssl
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes