Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. PySide6.QtQml.qmlRegisterType signature error in QtQml.pyi
Qt 6.11 is out! See what's new in the release blog

PySide6.QtQml.qmlRegisterType signature error in QtQml.pyi

Scheduled Pinned Locked Moved Solved Qt for Python
3 Posts 3 Posters 551 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    xhcoding
    wrote on last edited by
    #1

    qmlRegisterType signature:

    PySide6.QtQml.qmlRegisterType(type, bytes, int, int, bytes)
    

    But when I call method :

        qmlRegisterType(TestSet, b"Test", 1, 0, b"TestSet")
    
    

    I get error:

        qmlRegisterType(TestSet, b"Test", 1, 0, b"TestSet")
    ValueError: 'PySide6.QtQml.qmlRegisterType' called with wrong argument values:
      PySide6.QtQml.qmlRegisterType(<class 'testtool.testset.TestSet'>, b'Test', 1, 0, b'TestSet')
    Found signature:
      PySide6.QtQml.qmlRegisterType(type, bytes, int, int, bytes)
    
    1 Reply Last reply
    0
    • eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on last edited by
      #3

      @xhcoding There seems to be a bug in the PySide6 docs. String should be used instead of bytes:

      from PySide6.QtCore import QObject
      from PySide6.QtQml import qmlRegisterType
      
      
      class TestSet(QObject):
          pass
      
      
      qmlRegisterType(TestSet, "Test", 1, 0, "TestSet")
      

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      1 Reply Last reply
      1
      • ndiasN Offline
        ndiasN Offline
        ndias
        wrote on last edited by
        #2

        Hi @xhcoding ,

        I checked the PySide bug report system to see if there's something related with it but I didn't find anything. Maybe you can open a new ticket providing a description and a minimal script reproducing the issue.

        Regards

        1 Reply Last reply
        0
        • eyllanescE Offline
          eyllanescE Offline
          eyllanesc
          wrote on last edited by
          #3

          @xhcoding There seems to be a bug in the PySide6 docs. String should be used instead of bytes:

          from PySide6.QtCore import QObject
          from PySide6.QtQml import qmlRegisterType
          
          
          class TestSet(QObject):
              pass
          
          
          qmlRegisterType(TestSet, "Test", 1, 0, "TestSet")
          

          If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved