Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
6.1.0, 6.1.1, 6.1.2
-
None
-
Checked with Python 3.8.10 and Python 3.9.6, PySide6 6.1.0 to 6.1.2, inside a venv.
-
-
07b93a82afc22760f87a68fa9926dd316c4a0815 (pyside/pyside-setup/dev) 68d73ee9ed5571bd8de760fd25dbc6c0da1c496d (pyside/pyside-setup/6.1) 0042bb2706697e5f15ee914f84e37964f0001381 (pyside/tqtc-pyside-setup/5.15)
Description
The following code raises SystemError: <built-in method value of PySide6.QtCore.QSettings object at 0x...> returned NULL without setting an error at the last line.
from PySide6.QtCore import QSettings
from PySide6.QtGui import QColor
s: QSettings = QSettings('Qt', 'Logo')
s.value('height', 160.0, float)
s.value('color', QColor('#41cd52'), QColor)
However, if I omit the return type and use just
s.value('color', QColor('#41cd52'))
everything goes fine and returns QColor. What's wrong with QColor as a type? Actually, the error appears with every Qt class name used as a return type in QSettings.
Initially, this was posted on stackoverflow.com.
Attachments
For Gerrit Dashboard: PYSIDE-1619 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
358619,3 | Add fallback case for QSettings.value | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
359459,2 | Add fallback case for QSettings.value | 6.1 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
359462,3 | Add fallback case for QSettings.value | tqtc/lts-5.15 | pyside/tqtc-pyside-setup | Status: MERGED | +2 | 0 |