PEP561 stub files for the *Qt for Python/PySide6* framework
Project description
Mypy stubs for the PySide6 (Qt6 for Python)
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
.
Notable improvements:
- add all missing signals to the stubs (many were missing)
- add conversion from
QByteArray
tobytes
- add construction of
QByteArray
from length and string - fix
QFileDialog.getOpen*()
methods to acceptNone
as parent argument - fix
QLineEdit.setText()
to acceptNone
- fix
QTreeWidget.setItemWidget()
andQListWidget.setItemWidget()
to acceptNone
as a widget argument - fix
QProgressDialog.setCancelButton()
acceptingNone
- support all
QSize
andQSizeF
operations - fix
QTabBar.setButtonWidget()
to acceptNone
as a widget argument - fix
QTreeWidget.topLevelItem()
returning possiblyNone
- fix
QTreeWidgetItem
comparison with<
- fix
QMessageBox.warning
,information
,critical
,question
,about
,aboutQt
to acceptNone
as parent argument - fix
qVersion()
returns string, not bytes - fix
qDebug()
,qWarning()
,qCritical()
,qFatal()
,SIGNAL()
,SLOT()
to accept string, not bytes - fix
Signal.connect()
,Signal.disconnect()
,QObject.connect()
andQObject.disconnect()
to acceptstr
instead ofbool
, and to returnbool
on disconnect. - fix incorrect signature of
QCoreApplication.translate()
- improve signature of operations on
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.
Licensing
As a derived work from PySide6, the stubs are delivered under the LGPL v2.1 . See file LICENSE for more details.
Installation
Today, this work exists only inside the Git repository. So the installation command is:
$ pip install git+https://github.com/python-qt-tools/PySide6-stubs
As soon as a Python pip package is created, this will be reflected in the recommendations here.
Help improve the 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:
- create an issue showing your problem
- even better, create a PR to fix the problem. See CONTRIBUTING.md for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file PySide6-stubs-6.4.2.0.tar.gz
.
File metadata
- Download URL: PySide6-stubs-6.4.2.0.tar.gz
- Upload date:
- Size: 433.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5578eb1597d1c07831c899b35636410b08915a4695ce6e41cceb6707c400fcf |
|
MD5 | 7ca47972b3eb28924fc7a9cc5886f49d |
|
BLAKE2b-256 | 71851c504346a5da5b69ba59a235a897430dc302b9d3c12c4d41a849e4b5aff4 |
File details
Details for the file PySide6_stubs-6.4.2.0-py3-none-any.whl
.
File metadata
- Download URL: PySide6_stubs-6.4.2.0-py3-none-any.whl
- Upload date:
- Size: 469.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e825ded4b3555d540f297f405e3a9dc0943c032a96c53184cf644a8e4c4a6b0b |
|
MD5 | eda35e1c22f20a4e2c76915da898a852 |
|
BLAKE2b-256 | 44752e5f1bab9445805971d52563684a14fccf2a835b101f8f392db32cf631c5 |