Author : Philippe Fremy
This package provides improved typing stubs for Qt6 for Python/PySide6. The
official stubs delivered along with PySide6 are insufficent
for proper typing verification with mypy
.
QByteArray
to bytes
QByteArray
from length and stringQFileDialog.getOpen*()
methods to accept None
as parent argumentQLineEdit.setText()
to accept None
QTreeWidget.setItemWidget()
and QListWidget.setItemWidget()
to accept None
as a widget argumentQProgressDialog.setCancelButton()
accepting None
QSize
and QSizeF
operationsQTabBar.setButtonWidget()
to accept None
as a widget argumentQTreeWidget.topLevelItem()
returning possibly None
QTreeWidgetItem
comparison with <
QMessageBox.warning
, information
, critical
, question
, about
, aboutQt
to accept None
as parent argumentqVersion()
returns string, not bytesqDebug()
, qWarning()
, qCritical()
, qFatal()
, SIGNAL()
, SLOT()
to accept string, not bytesSignal.connect()
, Signal.disconnect()
, QObject.connect()
and QObject.disconnect()
to accept str
instead
of bool
, and to return bool
on disconnect.QCoreApplication.translate()
QPolygon
See CHANGELOG.md for full details.
This effort was inspired by the PyQt5-stubs and PySide2-stubs project.
Please note that this work is far from complete. Don't hesitate to report problems or propose improvements.
As a derived work from PySide6, the stubs are delivered under the LGPL v2.1 . See file LICENSE for more details.
Install from pypi:
$ pip install PySide6-stubs
If you want to install the stable development version from the Git repository:
$ pip install git+https://github.com/python-qt-tools/PySide6-stubs
If you notice incorrect or missing typing information (mypy reports errors eventhough your code is correct), please report it here with the following steps: