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

Class inheritance order breaks initialisation order

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4: Low
    • 6.5.0
    • 6.5.0
    • PySide
    • None
    • macOS

    Description

      This is related to issue: https://bugreports.qt.io/browse/PYSIDE-2294

      And the changes that were introduced in: https://github.com/pyside/pyside-setup/commit/e8095467f7d0332cc0987e7c541de9906e19fece

      There is an object in USD with the inheritance:

      ViewSettingsDataModel(QtCore.QObject, StateSource):
      

      When this is initialised thus:

      QtCore.QObject.__init__(self)
      StateSource.__init__(self, parent, "model")
      

      It results in an error:

      QtCore.QObject.__init__(self)
      TypeError:__init__() missing 2 required positional arguments: 'parent' and 'name'
      

      I worked around the issue by reversing the order of inheritance of QtCore.QObject and StateSource with this change: https://github.com/PixarAnimationStudios/USD/pull/2392

      I think this points to an error in PySide 6.5.0, but I don't have enough knowledge of the inner workings of Python and PySide to make a call on this.

      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
              jonton Jon Creighton
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes