gmarull / qtmodern

PyQt/PySide Widgets Modern User Interface
MIT License
751 stars 113 forks source link

qtmodern not working with PySide2 and python 3.7.5 #57

Open matthieubruneau opened 4 years ago

matthieubruneau commented 4 years ago

Hi, I'm currently trying to use your palette on my application. I did what you showed in the readme, and it's telling me this error when I am running the code:

TypeError: 'PySide2.QtWidgets.QApplication.setPalette' called with wrong argument types:
  PySide2.QtWidgets.QApplication.setPalette(QPalette)
Supported signatures:
  PySide2.QtWidgets.QApplication.setPalette(PySide2.QtGui.QPalette, typing.Union[bytes, NoneType] = None)
  PySide2.QtWidgets.QApplication.setPalette(PySide2.QtGui.QPalette)

Can it be because I'm using PySide2 and not qtpy? because I tried while importing with qtpy and this issue gets removed.

bactone commented 3 years ago

I encounter the same the problem, with pyside2 or pyside6

p0las commented 3 years ago

I think it is designed to work solely with qtpy. we use Qt.py wrapper (https://github.com/mottosso/Qt.py) and it breaks too. I was only able to get it to work with qtpy.

DanielRios549 commented 3 years ago

Python 3.8.5 and PySide2 5.15.2 here, the same error

Jerakin commented 3 years ago

This sounds like a qtpy error, but I would look into it. qtpy purpose is to make sure the same code can be run on PySide or PyQt. We are using it here so that the users can use qtmodern independent if they already are using PySide or PyQt in their application, there shouldn't be a need to use qtpy directly.

Unfortunately PySide6 isn't supported by qtpy so it's expected not to work there. But it should work with PySide2.

I would love if someone could also provide me with a minimal reproduction case, as well as which versions of qtpy, python and PySide2 you were using.