Giter Club home page Giter Club logo

pyside6-stubs's Introduction

mypy logo Continuous Integration

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 to bytes
  • add construction of QByteArray from length and string
  • fix QFileDialog.getOpen*() methods to accept None as parent argument
  • fix QLineEdit.setText() to accept None
  • fix QTreeWidget.setItemWidget() and QListWidget.setItemWidget() to accept None as a widget argument
  • fix QProgressDialog.setCancelButton() accepting None
  • support all QSize and QSizeF operations
  • fix QTabBar.setButtonWidget() to accept None as a widget argument
  • fix QTreeWidget.topLevelItem() returning possibly None
  • fix QTreeWidgetItem comparison with <
  • fix QMessageBox.warning, information, critical, question, about, aboutQt to accept None 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() and QObject.disconnect() to accept str instead of bool, and to return bool 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

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

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.

pyside6-stubs's People

Contributors

bluebird75 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.