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

PySide6 bug #484

Closed
hannesdelbeke opened this issue Apr 28, 2024 · 2 comments
Closed

PySide6 bug #484

hannesdelbeke opened this issue Apr 28, 2024 · 2 comments

Comments

@hannesdelbeke
Copy link

Hi

I founda bug, and believe it's related to PySide6.7 release.
starting an issue here to make others aware since I believe it might affect everyone using PyQt.

TLDR: using from .. import * and certain import orders break in Pyside6.7, and it seems qtpy triggers one of those conditions.

from PySide6 import QtWidgets

app = QtWidgets.QApplication()
window = QtWidgets.QWidget()
layout = QtWidgets.QVBoxLayout()
window.setLayout(layout)
window.show()
app.exec_()

this code throws an error

LogPython: Error: Traceback (most recent call last):
LogPython: Error:   File "<string>", line 1, in <module>
LogPython: Error:   File "D:\Program Files\Epic Games\UE_5.4\Engine\Binaries\ThirdParty\Python3\Win64\Lib\site-packages\plugget_qt\__init__.py", line 20, in test
LogPython: Error:     window.setLayout(layout)
LogPython: Error: TypeError: 'PySide6.QtWidgets.QWidget.setLayout' called with wrong argument types:
LogPython: Error:   PySide6.QtWidgets.QWidget.setLayout(QVBoxLayout)
LogPython: Error: Supported signatures:
LogPython: Error:   PySide6.QtWidgets.QWidget.setLayout(PySide6.QtWidgets.QLayout)
@hannesdelbeke
Copy link
Author

hannesdelbeke commented Apr 28, 2024

for now, to get around this, i replaced this line

import qtpy.QtWidgets as QtWidgets

with

try:
    import PySide6.QtWidgets as QtWidgets
except ImportError:
    import qtpy.QtWidgets as QtWidgets

which resolved my error in my app

LogPython: Error: WARNING:root:settings file not found: 'C:\Users\H\AppData\Roaming\plugget\settings_plugget.json'
LogPython: Error: Traceback (most recent call last):
LogPython: Error:   File "<string>", line 1, in <module>
LogPython: Error:   File "D:\Program Files\Epic Games\UE_5.4\Engine\Binaries\ThirdParty\Python3\Win64\Lib\site-packages\plugget_qt\__init__.py", line 270, in show
LogPython: Error:     window = MainWindow()
LogPython: Error:              ^^^^^^^^^^^^
LogPython: Error:   File "D:\Program Files\Epic Games\UE_5.4\Engine\Binaries\ThirdParty\Python3\Win64\Lib\site-packages\plugget_qt\__init__.py", line 250, in __init__
LogPython: Error:     central_widget = PluggetWidget(parent=self)
LogPython: Error:                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
LogPython: Error:   File "D:\Program Files\Epic Games\UE_5.4\Engine\Binaries\ThirdParty\Python3\Win64\Lib\site-packages\plugget_qt\__init__.py", line 62, in __init__
LogPython: Error:     self.search_widget.setLayout(search_layout)
LogPython: Error: TypeError: 'PySide6.QtWidgets.QWidget.setLayout' called with wrong argument types:
LogPython: Error:   PySide6.QtWidgets.QWidget.setLayout(QVBoxLayout)
LogPython: Error: Supported signatures:
LogPython: Error:   PySide6.QtWidgets.QWidget.setLayout(PySide6.QtWidgets.QLayout)

@ccordoba12
Copy link
Member

Hey @hannesdelbeke, thanks for reporting. This is basically a duplicate of issue #480 and it's not our fault.

It seems PySide 6.7 broke star imports, which is what we use all over the place in this library (instead of importing object by object).

@ccordoba12 ccordoba12 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 28, 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