Details
-
Bug
-
Resolution: Fixed
-
P4: Low
-
6.4.3
-
None
-
8b5b0458e (dev), 3082853a0 (6.6), f5a5e2775 (tqtc/lts-6.5), 267c75375 (dev), 6426249e4 (6.7), c06a64b89 (6.6), e5eb303bd (tqtc/lts-6.5), 5d9b5718f (6.6.3.1), 87222d432 (tqtc/6.6.3.1), d477f2d99 (dev), 88cd06100 (6.7), 4d8f0f44e (tqtc/lts-6.5)
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
- is duplicated by
-
PYSIDE-2452 Missing types for Public Variables
- Closed
-
PYSIDE-2467 QStyleOption missing type hints for member variables
- Closed
-
PYSIDE-2520 [Type Hints] Typing of properties for QStyleOption classes are broken
- Closed
- relates to
-
PYSIDE-1603 Missing signals in stubs
- Closed
-
PYSIDE-2324 Docs and stubs for QStyleOptionViewItem miss a lot of Public Variables
- Closed
- resulted in
-
PYSIDE-2653 Syntax errors in QtCore.pyi, QtGui.pyi
- Closed