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

Signals are not ordered correctly with multiple inheritance

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 6.3.1
    • PySide
    • None

    Description

      With multiple QObject parents, Sort Warning is raised when a signal from one of the parents is connected to function, and the subclass' slots are connected afterwards

      from PySide6 import QtCore
      
      class Object(QtCore.QObject):
          signal = QtCore.Signal()
      
      class OtherObject(QtCore.QObject):
          0
      
      class SubclassObject(OtherObject, Object):
          def slot(self):
              0
      
      app = QtCore.QCoreApplication()
      obj = SubclassObject()
      app.aboutToQuit.connect(obj.slot) # random signal
      obj.signal.connect(print)
      app.exec()

      causes

       

      *** Sort Warning ***
      Signals and slots in QMetaObject 'SubclassObject' are not ordered correctly, this may lead to issues.
      1 Slot slot()
      2! Signal signal()
      obj.signal.connect(print)
      

       

       

      Attachments

        Issue Links

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

          Activity

            People

              ctismer Christian Tismer
              numerlor Michal Laboš
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes