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.7 is majorly broken - TypeErrors everywhere
Forum Updated to NodeBB v4.3 + New Features

PySide6.7 is majorly broken - TypeErrors everywhere

Scheduled Pinned Locked Moved Unsolved Qt for Python
8 Posts 4 Posters 2.9k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    Aspecky
    wrote on last edited by Aspecky
    #1

    I was developing my app using pyside6 on windows and didnt pay attention to the version, when 6.7 came out yesterday (Apr 9th) my app broke (i think my pip packages auto update) spitting out TypeError everywhere, for example not even this would run:

    from PySide6.QtCore import *
    from PySide6.QtWidgets import *
    import sys
    
    app = QApplication([])
    
    window = QMainWindow()
    
    central_widget = QFrame()
    
    window.setCentralWidget(central_widget)
    
    sys.exit(app.exec())
    

    With the error being:

    TypeError: 'PySide6.QtWidgets.QMainWindow.setCentralWidget' called with wrong argument types:
      PySide6.QtWidgets.QMainWindow.setCentralWidget(QFrame)
    Supported signatures:
      PySide6.QtWidgets.QMainWindow.setCentralWidget(PySide6.QtWidgets.QWidget)
    

    Changing QFrame to QWidget doesnt cause an error.


    I spun up a quick windows 10 sandbox instance with pyside6.7 and got the same error, the previous release works as expected.

    JonBJ 1 Reply Last reply
    0
    • A Aspecky

      I was developing my app using pyside6 on windows and didnt pay attention to the version, when 6.7 came out yesterday (Apr 9th) my app broke (i think my pip packages auto update) spitting out TypeError everywhere, for example not even this would run:

      from PySide6.QtCore import *
      from PySide6.QtWidgets import *
      import sys
      
      app = QApplication([])
      
      window = QMainWindow()
      
      central_widget = QFrame()
      
      window.setCentralWidget(central_widget)
      
      sys.exit(app.exec())
      

      With the error being:

      TypeError: 'PySide6.QtWidgets.QMainWindow.setCentralWidget' called with wrong argument types:
        PySide6.QtWidgets.QMainWindow.setCentralWidget(QFrame)
      Supported signatures:
        PySide6.QtWidgets.QMainWindow.setCentralWidget(PySide6.QtWidgets.QWidget)
      

      Changing QFrame to QWidget doesnt cause an error.


      I spun up a quick windows 10 sandbox instance with pyside6.7 and got the same error, the previous release works as expected.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @Aspecky
      Oh dear! Assuming your finding is true/repeatable you will have to report this as a bug. You might verify whether it has anything to do with QFrame or whether any QWidget-derived class does same.

      A 1 Reply Last reply
      0
      • JonBJ JonB

        @Aspecky
        Oh dear! Assuming your finding is true/repeatable you will have to report this as a bug. You might verify whether it has anything to do with QFrame or whether any QWidget-derived class does same.

        A Offline
        A Offline
        Aspecky
        wrote on last edited by Aspecky
        #3

        @JonB This issue is very repeatable and i think it happens with every type, basically if you dont pass the exact type a function asks for then you'll get that error, for example this too will error:

        from PySide6.QtCore import *
        from PySide6.QtWidgets import *
        import sys
        
        app = QApplication([])
        
        window = QMainWindow()
        
        central_widget = QWidget()
        layout = QGridLayout()
        central_widget.setLayout(layout) # here
        
        window.setCentralWidget(central_widget)
        
        sys.exit(app.exec())
        

        Error:

        TypeError: 'PySide6.QtWidgets.QWidget.setLayout' called with wrong argument types:       
          PySide6.QtWidgets.QWidget.setLayout(QGridLayout)
        Supported signatures:
          PySide6.QtWidgets.QWidget.setLayout(PySide6.QtWidgets.QLayout)
        

        I am new to qt forums and would rather someone else make the bug report if possible 😅 . Could you do it? If not please link me to the bug report and i'll give it a shot.

        SGaistS 1 Reply Last reply
        0
        • A Aspecky

          @JonB This issue is very repeatable and i think it happens with every type, basically if you dont pass the exact type a function asks for then you'll get that error, for example this too will error:

          from PySide6.QtCore import *
          from PySide6.QtWidgets import *
          import sys
          
          app = QApplication([])
          
          window = QMainWindow()
          
          central_widget = QWidget()
          layout = QGridLayout()
          central_widget.setLayout(layout) # here
          
          window.setCentralWidget(central_widget)
          
          sys.exit(app.exec())
          

          Error:

          TypeError: 'PySide6.QtWidgets.QWidget.setLayout' called with wrong argument types:       
            PySide6.QtWidgets.QWidget.setLayout(QGridLayout)
          Supported signatures:
            PySide6.QtWidgets.QWidget.setLayout(PySide6.QtWidgets.QLayout)
          

          I am new to qt forums and would rather someone else make the bug report if possible 😅 . Could you do it? If not please link me to the bug report and i'll give it a shot.

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi and welcome to devnet,

          Don't be afraid ! The bug report system is here :-)

          Can you try again without using star imports ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          A 1 Reply Last reply
          0
          • SGaistS SGaist

            Hi and welcome to devnet,

            Don't be afraid ! The bug report system is here :-)

            Can you try again without using star imports ?

            A Offline
            A Offline
            Aspecky
            wrote on last edited by
            #5

            @SGaist Hello and thanks for the welcome!

            So it looks it's not the wildcards import, it's the act of importing PySide6.QtCore.

            As in this would TypeError at setCentralWidget:

            from PySide6.QtCore import * 
            from PySide6.QtWidgets import *
            import sys
            
            app = QApplication([])
            
            window = QMainWindow()
            
            central_widget = QFrame()
            
            window.setCentralWidget(central_widget)
            
            sys.exit(app.exec())
            

            and this wont:

            from PySide6.QtWidgets import *
            import sys
            
            app = QApplication([])
            
            window = QMainWindow()
            
            central_widget = QFrame()
            
            window.setCentralWidget(central_widget)
            
            sys.exit(app.exec())
            

            I reported the issue here

            SGaistS 1 Reply Last reply
            2
            • A Aspecky

              @SGaist Hello and thanks for the welcome!

              So it looks it's not the wildcards import, it's the act of importing PySide6.QtCore.

              As in this would TypeError at setCentralWidget:

              from PySide6.QtCore import * 
              from PySide6.QtWidgets import *
              import sys
              
              app = QApplication([])
              
              window = QMainWindow()
              
              central_widget = QFrame()
              
              window.setCentralWidget(central_widget)
              
              sys.exit(app.exec())
              

              and this wont:

              from PySide6.QtWidgets import *
              import sys
              
              app = QApplication([])
              
              window = QMainWindow()
              
              central_widget = QFrame()
              
              window.setCentralWidget(central_widget)
              
              sys.exit(app.exec())
              

              I reported the issue here

              SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Aspecky thanks !

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1
              • T Offline
                T Offline
                T0Mtom
                wrote on last edited by
                #7

                I have the same issue in 6.7 , 6.6.3.1 works well.

                JonBJ 1 Reply Last reply
                0
                • T T0Mtom

                  I have the same issue in 6.7 , 6.6.3.1 works well.

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by
                  #8

                  @T0Mtom
                  Yes. If you followed @Aspecky's link to the bug report they created you will see it links on to https://bugreports.qt.io/browse/PYSIDE-2674

                  Passes on 6.6.3.1 but fails on 6.7.0.

                  So they are aware! The problem/solution/workaround is that you either must not use from ... import * or you have to be careful about the order of such statements and how that relates to other non-* imports. Doubtless until they fix.

                  1 Reply Last reply
                  0

                  • Login

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