Giter Club home page Giter Club logo

pyside6-stubs's People

Contributors

bluebird75 avatar boldar99 avatar x-sam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

boldar99 x-sam

pyside6-stubs's Issues

Basic types missing (for things like Qt,Horizontal)

Types for many basic things like Qt.Horizontal seem to be missing.

Here is a bash sequence showing a simple example. In sequence it shows:

  1. Test env info
  2. Stock PySide6 stubs are completely broken
  3. PySide6-stubs (this github project) is somehow missing some basics
  4. IceSpringPySideStubs-PySide6 seems to be ok??
    • this seems odd since it hasn't been updated in 3 years, while this project is extremely recent. what am I missing here?
$ python --version
Python 3.11.8

$ pip freeze
mypy==1.9.0
mypy-extensions==1.0.0
PySide6==6.6.3
PySide6_Addons==6.6.3
PySide6_Essentials==6.6.3
shiboken6==6.6.3
typing_extensions==4.10.0

$ cat ./bugdemo.py
from PySide6.QtWidgets import QGraphicsView
from PySide6.QtCore import Qt

Qt.Horizontal
Qt.Vertical
QGraphicsView.ScrollHandDrag

$ mypy ./bugdemo.py
/home/russ/venvs/pyside6/lib/python3.11/site-packages/PySide6/QtCore.pyi:5858: error: invalid syntax  [syntax]
Found 1 error in 1 file (errors prevented further checking)

$ # pyside6 default stubs are completely broken!!?

$ pip install pyside6-stubs > /dev/null

$ mypy ./bugdemo.py
bugdemo.py:4: error: "type[Qt]" has no attribute "Horizontal"  [attr-defined]
bugdemo.py:5: error: "type[Qt]" has no attribute "Vertical"  [attr-defined]
bugdemo.py:6: error: "type[QGraphicsView]" has no attribute "ScrollHandDrag"  [attr-defined]
Found 3 errors in 1 file (checked 1 source file)

$ # pyside6-stubs are missing basics like Qt.Horizontal

$ pip uninstall pyside6-stubs -y > /dev/null

$ pip install IceSpringPySideStubs-PySide6
Collecting IceSpringPySideStubs-PySide6
  Using cached IceSpringPySideStubs_PySide6-1.3.1-py3-none-any.whl.metadata (14 kB)
Using cached IceSpringPySideStubs_PySide6-1.3.1-py3-none-any.whl (3.7 MB)
Installing collected packages: IceSpringPySideStubs-PySide6
Successfully installed IceSpringPySideStubs-PySide6-1.3.1

$ mypy ./bugdemo.py
Success: no issues found in 1 source file

Missing types for Public Variables

The variables that correspond to Public Variables of the C++ implementation don't have type annotations.

One example would be the QStyleOption class:
The C++ doc: https://doc.qt.io/qt-6/qstyleoption.html#public-variables
The PySides6 doc: https://doc.qt.io/qtforpython-6/PySide6/QtWidgets/QStyleOption.html#PySide6.QtWidgets.PySide6.QtWidgets.QStyleOption.version
Stubs: https://github.com/python-qt-tools/PySide6-stubs/blob/main/PySide6-stubs/QtWidgets.pyi#L7038-L7086

But other classes seem to miss these variables as well, e.g., QStyleHintReturnVariant, PixmapFragment.

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.