Qt for Python 6 released
December 10, 2020 by Cristián Maureira-Fredes | Comments
It is with great pleasure to announce that we have released a new version of Qt for Python for Qt 6 and a range of new features 🐍. PySide was initially released for Qt 4 and PySide2 for Qt 5.12. We have decided to follow the general Qt release versioning with this release, explaining the version leap to PySide6 and Shiboken6.
Let us explore the updates you will find with this release! 🎉
General information
We have included the number '6' in the project name, making the Python Package Index (PyPi) different, so to pip install, you will need to refer to the packages as "pyside2/shiboken2" for 5.x and "pyside6/shiboken6" for 6.x releases, rather than pip install pyside6==5.15.0, nor pyside2==6.0.
You can install the new release via: pip install pyside6
Another important update is that we support Python 3.9, and we have raised the minimum version to 3.6. We have performed a "Python 2 exorcism" in our code base, removing the language's deprecated version. Our users can achieve many benefits by adopting the newer versions of the language. It will enable you to use excellent language features in your Python code, such as f-strings, underscores in numerical literals, syntax for variable annotations, etc.
PySide6
With Qt 5.15.2, we introduced a new option called __feature__
, enabling you to switch between camelCase
and snake_case
for most Qt APIs. With Qt 6.0, you can directly access Qt properties from your Python code, leaving aside the setters and getters, with the new true_property
feature.
Check this comparison between the common code and what you can get with these new features together:
Normal Code | Enabling the feature option |
|
|
You will also encounter all the new QML features described in the previous blog post: Improved QML Support for Qt for Python 6.
Shiboken6
A new major release allows us to clean our code base, so we took this opportunity to go through all the corners of Shiboken, removed unused functionality, added new features, and re-organized the different internal processes, like the interaction with the ApiExtractor or the CppGenerator.
For the binding generation, we added more options to our type system, for example enabling selecting the order of function overloads to use in the decisor. We also made it possible to declare properties, and finally, optionally expose a snake_case
name for your camelCase
functions while generating the bindings for your non-Qt based modules, complementing the switchable features of PySide6 for Qt-based modules.
On the C++ support for the binding generation, we improved the interaction with smart pointers. We extended it to handle the modern C++ features used in Qt 6, for example, the template type alias from QVector to QList, new exception specification keywords, operators written as hidden friends, and many more.
Collaboration
Many people want to contribute to the Qt for Python project, improving our documentation. Still, they encounter a hurdle when checking minor changes into our rst
files: building the whole project. The doc building process required you to build the complete API documentation (QDoc and friends), so it was a slow process. To make this easier, we introduced a build option to create local rst documentation, without including the API documentation, build_rst_docs
.
Even though we included this on 5.15.2, we want to keep an eye on what else can be done for our users to facilitate the contribution process.
With the __feature__
functionality in place, it is time to get our imagination to work and start thinking about the future of Qt for Python. For this, we require your help, and we would like to get feedback on the functionality you would like us to develop. Should we improve interaction with other Python modules, add new modules for specific use cases? Please let us know in the comment section below! 🙌
External Add-ons and commercial offering
Due to the changes in Qt Add-ons such as Image Formats, Shader Tools, etc, we are looking at some options to distribute them via Python packages better. The distribution will also affect commercial modules in 5.15.x, like CoAP, MQTT, and OpcUA. Another blog post will come when we have a new structure in place.
Blog Topics:
Comments
Subscribe to our newsletter
Subscribe Newsletter
Try Qt 6.9 Now!
Download the latest release here: www.qt.io/download.
Qt 6.9 is now available, with new features and improvements for application developers and device creators.
We're Hiring
Check out all our open positions here and follow us on Instagram to see what it's like to be #QtPeople.
Everythings are GOOOOOOOOD! I think finnally we (PySide lovers) will see PySide IDE in QT6. Thank you very much for this beautiful framework..
Cheers , thanks for your great effort ! I expect we could develop Android Apps using PySide6 soon.
We would like the same, the main issue if the lack of official Python support on Android, but at least we are looking for alternatives to the current scenario.
thing is you dont need "official python support", just provide a aarch64/arm64 version of pyside6 in PyPi, then we can use buildozer to make apk.
I have a custom built PyQt5 wheel file (Built by russian app dev and autor of PyDroid IDE for android) for aarch64/arm64 that works fine on Android. I am able to use qtwidgets as well as qml, that proves that problem is that you guys at Qt just dont want to build a wheel. I mean why onlly x86 and amd64 wheels are in PyPi ?
Of course we want to have other architecture wheels, why we wouldn't? It's just a matter of enabling an easy cross compilation configuration, so we can generate them easily, and properly test the whole project. Building PySide and Shiboken directly on armv7, and aarch64 systems it's as simpler as building on the main architectures, but that's not the goal, since at the moment in Qt's CI we only enable cross compilation. If you are willing to help the process, reach out with the community on the many platforms we have: https://wiki.qt.io/Qt_for_Python#Community since we are all interested into getting arm wheels soon.
It would be awesome if PySide integrated with Python's async/await!
This is something that we want! but at the moment we haven't been able to contribute back to https://github.com/gmarull/asyncqt to get a compatible module, so we later can implement something similar inside PySide. If you have some experience, maybe you can give that plugin a hand and improve it to work with PySide6.
qt5reactor (Twisted) and QTrio (Trio) both work with PySide2 anyways. I haven't had a chance to work on PySide6 support for either of them. -- https://github.com/twisted/qt5reactor -- https://qtrio.readthedocs.io/en/stable/
Really excited to learn PySide6, with a whole new range of features
Would be really cool to get even basic support for exr image file format because it's defacto standard for visual effects industry. Maybe even USD (universal scene description) at some point.
First time I heard about that format Dawid, maybe you can share more information creating a User Story in our JIRA? so we can move the discussion there and see what we can do: https://bugreports.qt.io/projects/PYSIDE
I'd love to see improved interaction with Nuitka! This would let me make a compiled, distributable Python program with a nice GUI!
I love the feature stuff. This will definitely bring Qt to a wider Python audience.
Are Python properties now also exposed as Qt properties for QtObjects or do we still require the whole decoration stuff? If so, this would be a feature I really would like to have.
The article was absolutely fantastic! Lot of great information which can be helpful in some or the other way. Keep updating the blog, looking forward for more contents. by cognex(https://www.cognextech.com/aws-training-and-certification-course-3)
A splendid job! Thank you for blog. Lot of great information which can be helpful in some or the other way. if you want to fly in your life so you can do Air Hostess Course
Thanks for sharing this valuable information with our vision. You have posted a trustworthy blog keep sharing. https://www.slainstitute.com/aws-training-in-chennai/
amazing write , keep posting and if you are intresting in big data coder and code developer then checkout python classes in satara
Your article is too good and informative. It will be helpful for other readers also. https://www.webasha.com/courses/soc
"Interesting post! It provided valuable insights and sparked a thought-provoking discussion." "Great read! The content was informative, well-written, and kept me engaged throughout." CEH Practical Training in Pune
"Interesting post! It provided valuable insights and sparked a thought-provoking discussion." "Great read! The content was informative, well-written, and kept me engaged throughout." CEH Practical Training in Pune
Nice Post, Thanks For Sharing. Keep Posting 👍👍 https://www.webasha.com/courses/linux-training-mumbai
Great job on the blog! Thank you for sharing such valuable information that can be incredibly helpful. If you're aiming to soar in your career, consider enrolling in an Air Hostess Course. https://cybersecurityacademy.in/
I have read your blog it was nice blog I can't share my in my words thank you for giving the information
pyqt5: QImage.Format_BGR888
pyqt6: QImage.Format.Format_BGR888
pyqt7: QImage.Format.Format.Format.Format_BGR888
like to appreciate the efforts you get with writing this post. Thanks for sharing. https://www.sevenmentor.com/best-python-classes-in-pune.php