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

QColorConstants type hints are incomplete

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 6.4.3
    • PySide
    • None

    Description

      Mypy does not recognize components of QColorConstants.

      bug.py:
       

      from PySide6.QtGui import QColorConstants
      print(QColorConstants.Red)

      Output:

      (project_3.11) C:\code\project>python bug.py
      PySide6.QtGui.QColor.fromRgbF(1.000000, 0.000000, 0.000000, 1.000000)
      (project_3.11) C:\code\project>mypy bug.py
      bug.py:3: error: "Type[QColorConstants]" has no attribute "Red"  [attr-defined]
      Found 1 error in 1 file (checked 1 source file)
      

       

      In fact, QtGui.pyi looks incomplete:
       

      class QColorConstants(Shiboken.Object): 
      
          class Svg(Shiboken.Object): ...

       

      Related: https://bugreports.qt.io/browse/PYSIDE-1224

      namespace QColorConstants
      {
          // Qt::GlobalColor names
          constexpr inline QColor Color0      {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0x00 * 0x101};
      

      Attachments

        Issue Links

          Activity

            People

              crmaurei Cristian Maureira-Fredes
              bers bers bers
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: