ColinDuquesnoy / QDarkStyleSheet

A dark style sheet for QtWidgets application
Other
2.76k stars 726 forks source link

Issue with PySide2 tests in latest release #275

Closed ArchangeGabriel closed 2 years ago

ArchangeGabriel commented 3 years ago

Describe Your Environment

Description / Steps to Reproduce

python -m qdarkstyle.example --qt_from=pyside2 --test --offscreen

Actual Result

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-builduser'
INFO:qdarkstyle:QSS file sucessfuly loaded.
INFO:qdarkstyle:Found version patches to be applied.
INFO:qdarkstyle:Found application patches to be applied.
INFO:__main__:QDarkStyle Example - (QDarkStyle=v3.0.2, QtPy=v1.9.0, PySide2=v5.15.2, Qt=v5.15.2, Python=v3.9.2, System=Linux, Release=5.11.10-arch1-1, Version=#1 SMP PREEMPT Fri, 26 Mar 2021 00:11:29 +0000, Platform=Linux-5.11.10-arch1-1-x86_64-with-glibc2.33)
You can't add dynamic slots on an object originated from C++.
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/build/python-qdarkstyle/src/QDarkStyleSheet-3.0.2/qdarkstyle/example/__main__.py", line 383, in <module>
    sys.exit(main())
  File "/build/python-qdarkstyle/src/QDarkStyleSheet-3.0.2/qdarkstyle/example/__main__.py", line 167, in main
    dw_buttons.checkBoxTristate.setCheckState(1)
TypeError: 'PySide2.QtWidgets.QCheckBox.setCheckState' called with wrong argument types:
  PySide2.QtWidgets.QCheckBox.setCheckState(int)
Supported signatures:
  PySide2.QtWidgets.QCheckBox.setCheckState(PySide2.QtCore.Qt.CheckState)

Expected Results / Proposed Result

No error.

ArchangeGabriel commented 3 years ago

From the documentation of PySide, this should be an enum with three possible values: Qt.Unchecked, Qt.PartiallyChecked, Qt.Checked.

And I can confirm that changing to e.g. QtCore.Qt.Unchecked does work. Since I’m not sure which value you want in there, I won’t open a PR for it but it should be an easy fix. ;)