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

Misleading type error for QMetaObject.indexOfMethod

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4: Low
    • 6.5.2, 6.6.0
    • 6.5.0
    • Type hints
    • None
    • All
    • 551e6d68e (dev), a31777a69 (6.5)

    Description

      QMetaObject::indexOfMethod(const char*);
      
          index = metaobject.indexOfMethod(b"destroyed")
      ValueError: 'PySide6.QtCore.QMetaObject.indexOfMethod' called with wrong 
      argument values:   PySide6.QtCore.QMetaObject.indexOfMethod(b'destroyed',)
      Found signature:
        PySide6.QtCore.QMetaObject.indexOfMethod(bytes)
      

      It seems that indexOfMethod (and perhaps also the other indexOf methods) is broken. 

      When passing the name as bytes, it throws a ValueError, when passing the name as str it just returns -1.

      Example should make it obvious.

      Cheers!

       

      UPDATE: Was error on my side. The misleading Exception message could still be fixed.

      Attachments

        Issue Links

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

          Activity

            People

              kleint Friedemann Kleint
              phil__65 Philipp Temminghoff
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes