Skip to content

setWeight argument type difference between pyqt6 and pyside6 #512

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

Open
oscargus opened this issue Apr 29, 2025 · 0 comments
Open

setWeight argument type difference between pyqt6 and pyside6 #512

oscargus opened this issue Apr 29, 2025 · 0 comments

Comments

@oscargus
Copy link

When generating a UI with QT Designer and compiling it with pyqt6 the argument type to setWeight is not compatible with pyside6. pyside6 uses an IntEnum, while pyqt6 uses an int.

FAILED test/unit/test_scheduler_gui.py::test_start - TypeError: 'PySide6.QtGui.QFont.setWeight' called with wrong argument types:
  PySide6.QtGui.QFont.setWeight(int)
Supported signatures:
  PySide6.QtGui.QFont.setWeight(weight: PySide6.QtGui.QFont.Weight, /)

Currently, I solve that by just removing those calls manually (I am pretty sure that I didn't do anything in QT Designer on purpose to change font, but I may very well have done it, but that probably means that others will have the same problem).

https://www.riverbankcomputing.com/static/Docs/PyQt6/api/qtgui/qfont.html#setWeight
https://doc.qt.io/qtforpython-6/PySide6/QtGui/QFont.html#PySide6.QtGui.QFont.setWeight

By compiling using pyside6 this is not a problem (at least not since I do not think I set the weight...), but it would be a slight improvement if it was possible to use setWeight in both toolkits.

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

1 participant