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

connectNotify doesn't exist when using snake_case feature

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Done
    • Affects Version/s: 6.0.0
    • Fix Version/s: None
    • Component/s: PySide
    • Labels:
      None
    • Environment:
      macOS Big Sur (Intel)
    • Platform/s:
      macOS
    • Commits:
      d158720ec4dd3fe8623faaf9afcb2e7f9f368e51 (pyside/pyside-setup/dev) b7110476aed3216d6c9631dc67231ac97c576887 (pyside/tqtc-pyside-setup/tqtc/lts-5.15) 84eaf8c056b01f91cbd29ff5a363829710688510 (pyside/pyside-setup/6.0)

      Description

      After activating new snake_case feature some internal code still trying to access camelCase attributes (I suppose) which doesn't exist anymore. When disabling the feature (and, of course, renaming methods back to camelCase), the problem has gone. Snippet to reproduce:

      import sys
      
      from PySide6.QtCore import QStringListModel
      
      from PySide6.QtGui import QGuiApplication
      from PySide6.QtQml import QQmlApplicationEngine
      
      # noinspection PyUnresolvedReferences
      from __feature__ import snake_case, true_property
      
      
      def create_app():
          app = QGuiApplication(sys.argv)
          engine = QQmlApplicationEngine(parent=app)
          some_list_model = QStringListModel(parent=engine)
          engine.root_context().set_context_property('someListModel', some_list_model)
          return app
      
      def main():
          app = create_app()
          return app.exec_()
      
      if __name__ == '__main__':
          sys.exit(main())
      

      Traceback is (last line):

          engine.root_context().set_context_property('someListModel', some_list_model)
      AttributeError: 'PySide6.QtCore.QStringListModel' object has no attribute 'connectNotify'

        Attachments

        1. pyside1478_camelcase_log.txt
          2 kB
          Friedemann Kleint
        2. pyside1478_camelcase.py
          0.5 kB
          Friedemann Kleint
        3. pyside1478_diag.diff
          1 kB
          Friedemann Kleint
        4. pyside1478_libshiboken_diag.diff
          2 kB
          Friedemann Kleint
        5. pyside1478_stack.txt
          33 kB
          Friedemann Kleint
        6. pyside1478.py
          0.6 kB
          Friedemann Kleint
        For Gerrit Dashboard: PYSIDE-1478
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            ctismer Christian Tismer
            Reporter:
            ussserrr Андрей Чуфырев
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: