nucleic / enaml

Declarative User Interfaces for Python
http://enaml.readthedocs.io/en/latest/
Other
1.53k stars 130 forks source link

QLabel broken with PySide 6.7.0 #547

Closed bburan closed 5 months ago

bburan commented 5 months ago

A fresh checkout of enaml with pip install enaml[qt6-pyside] pulls in PySide 6.7.0. Running enaml-run enaml/examples/widgets/field.enaml gives the following stacktrace:

(test-enaml) C:\Users\bburan\projects\src\enaml\examples\widgets>enaml-run field.enaml
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\bburan\anaconda3\envs\test-enaml\Scripts\enaml-run.exe\__main__.py", line 7, in <module>
  File "C:\Users\bburan\projects\src\enaml\enaml\runner.py", line 69, in main
    window.show()
  File "C:\Users\bburan\projects\src\enaml\enaml\widgets\window.py", line 382, in show
    self.activate_proxy()
  File "C:\Users\bburan\projects\src\enaml\enaml\widgets\toolkit_object.py", line 213, in activate_proxy
    child.activate_proxy()
  File "C:\Users\bburan\projects\src\enaml\enaml\widgets\toolkit_object.py", line 213, in activate_proxy
    child.activate_proxy()
  File "C:\Users\bburan\projects\src\enaml\enaml\widgets\toolkit_object.py", line 210, in activate_proxy
    self.activate_top_down()
  File "C:\Users\bburan\projects\src\enaml\enaml\widgets\toolkit_object.py", line 226, in activate_top_down
    self.proxy.activate_top_down()
  File "C:\Users\bburan\projects\src\enaml\enaml\qt\qt_toolkit_object.py", line 73, in activate_top_down
    self.create_widget()
  File "C:\Users\bburan\projects\src\enaml\enaml\qt\qt_label.py", line 47, in create_widget
    self.widget = QLabel(self.parent_widget())
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'PySide6.QtWidgets.QLabel.__init__' called with wrong argument types:
  PySide6.QtWidgets.QLabel.__init__(QContainer)
Supported signatures:
  PySide6.QtWidgets.QLabel.__init__(Optional[PySide6.QtWidgets.QWidget] = None, PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags))
  PySide6.QtWidgets.QLabel.__init__(str, Optional[PySide6.QtWidgets.QWidget] = None, PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags))
sccolbert commented 5 months ago

Seems like a bug in PySide. QContainer inherits QWidget, so the first supported signature should match.

On Fri, Apr 12, 2024 at 5:27 PM Brad Buran @.***> wrote:

A fresh checkout of enaml with pip install enaml[qt6-pyside] pulls in PySide 6.7.0. Running enaml-run enaml/examples/widgets/field.enaml gives the following stacktrace:

(dbtx-ep) C:\Users\bburan\projects\consulting\Decibel\dbtx-ep\src\enaml\examples\widgets>enaml-run field.enaml Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "C:\Users\bburan\anaconda3\envs\dbtx-ep\Scripts\enaml-run.exe__main.py", line 7, in File "C:\Users\bburan\projects\consulting\Decibel\dbtx-ep\src\enaml\enaml\runner.py", line 69, in main window.show() File "C:\Users\bburan\projects\consulting\Decibel\dbtx-ep\src\enaml\enaml\widgets\window.py", line 382, in show self.activate_proxy() File "C:\Users\bburan\projects\consulting\Decibel\dbtx-ep\src\enaml\enaml\widgets\toolkit_object.py", line 213, in activate_proxy child.activate_proxy() File "C:\Users\bburan\projects\consulting\Decibel\dbtx-ep\src\enaml\enaml\widgets\toolkit_object.py", line 213, in activate_proxy child.activate_proxy() File "C:\Users\bburan\projects\consulting\Decibel\dbtx-ep\src\enaml\enaml\widgets\toolkit_object.py", line 210, in activate_proxy self.activate_top_down() File "C:\Users\bburan\projects\consulting\Decibel\dbtx-ep\src\enaml\enaml\widgets\toolkit_object.py", line 226, in activate_top_down self.proxy.activate_top_down() File "C:\Users\bburan\projects\consulting\Decibel\dbtx-ep\src\enaml\enaml\qt\qt_toolkit_object.py", line 73, in activate_top_down self.create_widget() File "C:\Users\bburan\projects\consulting\Decibel\dbtx-ep\src\enaml\enaml\qt\qt_label.py", line 47, in create_widget self.widget = QLabel(self.parent_widget()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'PySide6.QtWidgets.QLabel.init' called with wrong argument types: PySide6.QtWidgets.QLabel.init(QContainer) Supported signatures: PySide6.QtWidgets.QLabel.init(Optional[PySide6.QtWidgets.QWidget] = None, PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) PySide6.QtWidgets.QLabel.init__(str, Optional[PySide6.QtWidgets.QWidget] = None, PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags))

— Reply to this email directly, view it on GitHub https://github.com/nucleic/enaml/issues/547, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABBQSII3NE74NXS66K2Z7LY5BNTTAVCNFSM6AAAAABGE3YKXCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2DCMBWGQZTMNI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

bburan commented 5 months ago

Yes, makes sense. I will close this issue and notify the PySide devs.

MatthieuDartiailh commented 5 months ago

Thanks @bburan

bburan commented 4 months ago

For reference, this is the core issue. https://github.com/spyder-ide/qtpy/issues/480