Skip to content

Odd code found for PyQt6: always raises an exception #469

@StSav012

Description

@StSav012

The following lines assume that in PyQt6.QtGui, there is a Qt object.

qtpy/qtpy/QtCore.py

Lines 49 to 55 in c046821

# For issue #311
# Seems like there is an error with sip. Without first
# trying to import `PyQt6.QtGui.Qt`, some functions like
# `PyQt6.QtCore.Qt.mightBeRichText` are missing.
if not TYPE_CHECKING:
with contextlib.suppress(ImportError):
from PyQt6.QtGui import Qt

However, in PyQt6 versions 6.2.4, 6.5.3, and 6.6.0, there is no attribute Qt in QtGui. The code seems to be placed there mistakenly.

The issue referenced in the comment is #313.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions