Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QWidget.setLayout() broken #487

Closed
leon-thomm opened this issue May 18, 2024 · 1 comment
Closed

QWidget.setLayout() broken #487

leon-thomm opened this issue May 18, 2024 · 1 comment

Comments

@leon-thomm
Copy link

leon-thomm commented May 18, 2024

The following code works fine when commenting out the qtpy imports, but raises an exception when commenting out the PySide6 imports.

from qtpy.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QBoxLayout, QLayout
# from PySide6.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QBoxLayout, QLayout

app = QApplication()
mw  = QMainWindow()
w = QWidget()
l = QVBoxLayout(w)
w.setLayout(l)
> QT_API=pyside6 python ./tmp.py
Traceback (most recent call last):
  File "/home/<--snip-->/tmp.py", line 8, in <module>
    w.setLayout(l)
TypeError: 'PySide6.QtWidgets.QWidget.setLayout' called with wrong argument types:
  PySide6.QtWidgets.QWidget.setLayout(QVBoxLayout)
Supported signatures:
  PySide6.QtWidgets.QWidget.setLayout(PySide6.QtWidgets.QLayout)

Is there a workaround for this that works with the current qtpy version?

> python --version
Python 3.10.12
> pip list
Package            Version
------------------ -------
packaging          24.0
pip                22.0.2
PySide6            6.7.0
PySide6_Addons     6.7.0
PySide6_Essentials 6.7.0
QtPy               2.4.1
setuptools         59.6.0
shiboken6          6.7.0
@ccordoba12
Copy link
Member

Hey @leon-thomm, thanks for reporting. This is a duplicate of issue #480.

In the meantime, please downgrade to version 6.6.

@ccordoba12 ccordoba12 closed this as not planned Won't fix, can't repro, duplicate, stale May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants