Skip to main content

PEP561 stub files for the *PySide2/Qt5 for Python* framework

Project description

mypy logo

CI

Mypy stubs for the PySide2 (Qt5 for Python)

Author : Philippe Fremy (with inspiration from the PyQt5-stubs project)

If you want to use mypy with your PySide2 project and found the official stubs to be of insufficient quality, you are at the right place. This project improves the official stubs delivered by Qt5 for Python/PySide2.

Improvements:

  • fix Signal with method emit()
  • fix qVersion() returning string, not bytes
  • fix QMessageBox.warning, information, critical, question, about, aboutQt to accept None as parent argument
  • fix QAction.setShortcut() to accept string as argument
  • fix QTreeWidgetItem comparison with <
  • fix QTimer.timeout undeclared signal
  • fix QLineEdit.setText() to accept None

See CHANGELOG.md for more details.

Please note that this work is far from complete. Don't hesitate to report problems or propose improvements.

Licensing

As a derived work from PySide2, the stubs are delivered under the LGPL v2.1 . See file LICENSE for more details.

Installation

Simply install the official PySide2-stubs with pip:

$ pip install PySide2-stubs

Or use the latest version from Github:

$ pip install git+https://github.com/bluebird75/PySide2-stubs

That's it, in both cases, the new stubs are picked up automatically by mypy. Typechecking process should be much better.

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
    • make sure to add a test showing what is mistyped. Just create a file under tests/ , with a name not starting with test. The test suite will run the file and type-check it.
    • fix the stubs in the PySide2-stubs directory
    • and open the PR

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PySide2-stubs-5.15.2.1.0.tar.gz (479.1 kB view details)

Uploaded Source

Built Distribution

PySide2_stubs-5.15.2.1.0-py3-none-any.whl (516.6 kB view details)

Uploaded Python 3

File details

Details for the file PySide2-stubs-5.15.2.1.0.tar.gz.

File metadata

  • Download URL: PySide2-stubs-5.15.2.1.0.tar.gz
  • Upload date:
  • Size: 479.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.2

File hashes

Hashes for PySide2-stubs-5.15.2.1.0.tar.gz
Algorithm Hash digest
SHA256 9566ae1a2a5cfe55740b1d934c054495faea287ca7b0f6838a2aa8bd5e99501e
MD5 db45d1803779158903897b6d99664033
BLAKE2b-256 40a3c64a024fba493c259cca54c708013bfe3f91167d936996ece5286e26035b

See more details on using hashes here.

File details

Details for the file PySide2_stubs-5.15.2.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for PySide2_stubs-5.15.2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1255ef24ec9f163f32f199172245da0d396a9f1bcdd736f9d3955741d4ff210
MD5 850fd52dc5af94c1e239904ec6efed39
BLAKE2b-256 ea6cc81ffb1270fdc6d065276b19c8b492e11ca6922b46fc13a538d45da2a5ef

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page