gmarull/qtmodern

TypeError: 'PySide2.QtWidgets.QApplication.setPalette' called with wrong argument types:

breitburg opened this issue · 1 comments

Code:

from PySide2.QtCore import *
from PySide2.QtWidgets import *
app = QApplication([])

from qtmodern.styles import dark
dark(app)

Traceback:

Traceback (most recent call last):
  File "main.py", line 6, in <module>
    dark(app)
  File "/usr/local/lib/python3.6/dist-packages/qtmodern/styles.py", line 69, in dark
    app.setPalette(darkPalette)
TypeError: 'PySide2.QtWidgets.QApplication.setPalette' called with wrong argument types:
  PySide2.QtWidgets.QApplication.setPalette(QPalette)
Supported signatures:
  PySide2.QtWidgets.QApplication.setPalette(PySide2.QtGui.QPalette, str=None)
  PySide2.QtWidgets.QApplication.setPalette(PySide2.QtGui.QPalette)

Changing import in qtmodern/styles.py at line 3 to

from PySide2.QtGui import QPalette, QColor

solved the problem.