-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
Currently QtGui.QImage.loadFromData is typed as follows:
def loadFromData(self, data: PySide2.QtCore.QByteArray | bytes, aformat: bytes | None = ...) -> bool: ...PySide2 documents this function with the equivalent of this:
@typing.overloads
def loadFromData(self, fileName: str, format: str | None = ...) -> bool: ...
@typing.overloads
def loadFromData(self, data: PySide2.QtCore.QByteArray | bytes, aformat: str | None = ...) -> bool: ...Using the below code example:
from PySide2 import QtCore, QtGui
image = QtGui.QImage()
with open("/path/to/image.png", "rb") as in_f:
image.loadFromData(QtCore.QByteArray.fromBase64(in_f.read()), "PNG")I get the following error when running mypy:
tst.py:5: error: Argument 2 to "loadFromData" of "QImage" has incompatible type "str"; expected "bytes | None" [arg-type]
Found 1 error in 1 file (checked 1 source file)
Metadata
Metadata
Assignees
Labels
No labels