Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing types for Public Variables #3

Open
boldar99 opened this issue Aug 29, 2023 · 3 comments
Open

Missing types for Public Variables #3

boldar99 opened this issue Aug 29, 2023 · 3 comments

Comments

@boldar99
Copy link
Contributor

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.

@bluebird75
Copy link
Contributor

Indeed.

One would have to experiment to see if we can detect which variables are public variables, and what their type is. Then amend the stubs with this information.

I am not sure that it is feasible, it might be just easier to report that to Qt and wait looooooooooooooong for their fix.

@boldar99
Copy link
Contributor Author

boldar99 commented Sep 3, 2023

Thanks for the response! I have submitted an issue to Qt: https://bugreports.qt.io/browse/PYSIDE-2452. Hopefully, they'll fix it soon!

@bluebird75
Copy link
Contributor

I tried with #5 . I can identify public variable, I can identify some limited type information. Unfortunately, I can not get a fully qualified type name. I can identify a type as "QRect" or "StateFlag". But this is not sufficient for annotating the variables. Especially since some subclasses in Qt can have the same name in multiple different classes.

So, parsing the stubs is not going to solve this problem.

I have no other ideas at the moment...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants