Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1619

Qt class as the return type in QSettings().value(...) produces SystemError

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.15.4
    • 6.1.0, 6.1.1, 6.1.2
    • PySide
    • None
    • Checked with Python 3.8.10 and Python 3.9.6, PySide6 6.1.0 to 6.1.2, inside a venv.
    • Linux/X11
    • 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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            stsav012 Anton Yablokov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes