Qt for Python: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(63 intermediate revisions by 10 users not shown)
Line 1: Line 1:
[[Category:Qt for Python]]
[[Category:Qt for Python]]
{{LangSwitch}}
{{LangSwitch}}
http://doc-snapshots.qt.io/qtforpython/_static/pysidelogo.png
==Qt for Python==
== Qt for Python ==
[[File:Qtforpython2023.png|thumb|left|Qt for Python official logo.]] The '''[https://www.qt.io/qt-for-python Qt for Python]''' project aims to provide a complete port of the [[PySide]] module to Qt. The development started on [https://github.com/PySide GitHub] in May 2015. The project managed to port PySide to Qt 5.3, 5.4 & 5.5. During April 2016 The Qt Company decided to properly support the port (see [https://groups.google.com/forum/#!topic/pyside-dev/pqwzngAGLWE details] ).
The '''[https://www.qt.io/qt-for-python Qt for Python]''' project aims to provide a complete port of the [[PySide]] module to Qt 5. The development started on [https://github.com/PySide GitHub] in May 2015. The project managed to port Pyside to Qt 5.3, 5.
4 & 5.5. During April 2016 The Qt Company decided to properly support the port (see [https://groups.google.com/forum/#!topic/pyside-dev/pqwzngAGLWE details] ).


The module was released mid June 2018 as a Technical Preview (supporting Qt 5.11),
The module was released mid June 2018 as a Technical Preview (supporting Qt 5.11),
and it was officially released without the Technical Preview tag, in December 2018 for Qt 5.12.
and it was officially released without the Technical Preview tag, in December 2018 for Qt 5.12.
In December 2020, the module was released for Qt6, which is the latest available version, which has the following differences:
*It doesn't support Python 2.7,
*Dropped support for Python 3.5, keeping 3.6+ only until PySide 6.3
*PySide 6.4 is the first version that supports Python 3.7+


This wiki page tracks the progress of the '''Qt for Python''' project development and provides further information concerning the effort.
This wiki page tracks the progress of the '''Qt for Python''' project development and provides further information concerning the effort.


'''Qt for Python''' is available under LGPLv3/GPLv2 and commercial license for the following platforms:
'''Qt for Python''' is available under [https://tldrlegal.com/license/gnu-lesser-general-public-license-v3-(lgpl-3) LGPLv3]/[https://tldrlegal.com/license/gnu-general-public-license-v2 GPLv2] and [https://www.qt.io/download commercial license] for the following platforms:


{| class="wikitable"
|-
|
{| class="wikitable"
{| class="wikitable"
| - |
| - |
!colspan="2" style="background: #aec6cf;text-align: center;"|Linux
! colspan="3" style="background: #aec6cf;text-align: center;" |Linux
!colspan="2" style="background: #aec6cf;text-align: center;"|macOS
! colspan="3" style="background: #aec6cf;text-align: center;" |macOS
!colspan="2" style="background: #aec6cf;text-align: center;"|Windows
! colspan="2" style="background: #aec6cf;text-align: center;" |Windows
|-
|-
| |
| |
|style="background: #fdfd96;text-align: center;"|32bit
| style="background: #fdfd96;text-align: center;" |i386
|style="background: #ffb347;text-align: center;"|64bit
| style="background: #ffb347;text-align: center;" |amd64
|style="background: #fdfd96;text-align: center;"|32bit
| style="background: #ffb347;text-align: center;" |arm64
|style="background: #ffb347;text-align: center;"|64bit
| style="background: #fdfd96;text-align: center;" |32bit
|style="background: #fdfd96;text-align: center;"|32bit
| style="background: #ffb347;text-align: center;" |64bit
|style="background: #ffb347;text-align: center;"|64bit
| style="background: #ffb347;text-align: center;" |Apple Silicon
| style="background: #fdfd96;text-align: center;" |32bit
| style="background: #ffb347;text-align: center;" |64bit
|-
|-
|style="background: #aec6cf;text-align: center;"|'''Python 2.7'''
| style="background: #aec6cf;text-align: center;" |'''Python 3.7+'''
|style="background: #ff6961;text-align: center;"| *
| style="background: #ff6961;text-align: center;" |
|style="background: #77dd77;text-align: center;"|
| style="background: #77dd77;text-align: center;" |
|style="background: #ff6961;text-align: center;"| *
| style="background: #f76300;text-align: center;" |
|style="background: #77dd77;text-align: center;"|  
| style="background: #ff6961;text-align: center;" |
|style="background: #ff6961;text-align: center;"| **
| style="background: #77dd77;text-align: center;" |
|style="background: #ff6961;text-align: center;"| **
| style="background: #77dd77;text-align: center;" |⦿
|-
| style="background: #ff6961;text-align: center;" |
|style="background: #aec6cf;text-align: center;"|'''Python 3.5+'''
| style="background: #77dd77;text-align: center;" |
|style="background: #ff6961;text-align: center;"| *
|}
|style="background: #77dd77;text-align: center;"|  
||
|style="background: #ff6961;text-align: center;"| *
*<nowiki>⁜</nowiki> Partially supported via cross compilation
|style="background: #77dd77;text-align: center;"|
*<nowiki>✸</nowiki> No Qt Support https://doc.qt.io/qt-6/supported-platforms.html
|style="background: #77dd77;text-align: center;"|
*<nowiki>☆</nowiki> Not supported / No packages
|style="background: #77dd77;text-align: center;"|
*<nowiki>⦿</nowiki> Supported from 6.2.2 / Can be built from source
*<nowiki>✦</nowiki>: 5.14 is the first version to support Python 3.8, but Python 3.8.0 will not work on Windows. Please use '''Python 3.8.1''' or greater.
*'''Please notice''' that iOS, and WebAssembly are not supported yet.
|}
|}


<nowiki>*</nowiki>: [[Qt_5.12_Tools_and_Versions#Software_configurations_for_Qt_5.12.0|No Qt release]].<br/>
<nowiki>**</nowiki>: [[Qt_for_Python/Considerations#Missing_Windows_.2F_Python_2.7_release|MSVC issue with Python 2.7 and Qt]]


'''Get PySide2 via pip by running:''' <span style="color:#41cd52;font-weight: bold;font-size: 18px;">pip install PySide2</span>
'''Get PySide6 via pip by running:''' <span style="font-family: monospace; font-weight: normal;background-color: #eaeaea;padding: 2px 4px;color: black;border-radius: 2px;display: inline;">pip install pyside6</span>
 
[[File:Pyside6 install.gif]]


=== What does it look like? ===
===What does it look like?===


{| class="wikitable"
|-
!Code!!Application
|-
|
<syntaxhighlight lang="python" line="line">
<syntaxhighlight lang="python" line="line">
import sys
import sys
from PySide2.QtWidgets import QApplication, QLabel
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QApplication, QLabel
                                                      
                                                      
if __name__ == "__main__":
if __name__ == "__main__":
     app = QApplication(sys.argv)
     app = QApplication(sys.argv)
     label = QLabel("Hello World")
     label = QLabel("Hello World", alignment=Qt.Alignment.AlignCenter)
     label.show()
     label.show()
     sys.exit(app.exec_())
     sys.exit(app.exec())
</syntaxhighlight>
</syntaxhighlight>
||
[[File:2020-12-16-101334 305x245 scrot.png]]
|}


More examples can be found in the [http://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples project's repository] inside the '''examples''' directory.
More examples can be found in the [http://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples project's repository] inside the '''examples''' directory.


== Getting Started ==
=== Python compatibility matrix ===
* [https://doc.qt.io/qtforpython/ Official documentation]
* [[Qt_for_Python/GettingStarted|Getting started guide for macOS, Windows and Linux]]: download, build and install instructions.
{| class="wikitable"
* [[Qt_for_Python/Tutorial|Tutorials]]: get started developing PySide2 applications.
|-
* [[Qt_for_Python/Shiboken|Shiboken]]: general information about the Python binding generator.
!                                                              !! 2.7 !! 3.5 !! 3.6 !! 3.7 !! 3.8 !! 3.9 !! 3.10 !! 3.11 !! 3.12 !! 3.13
* [[Qt_for_Python/Development_Getting_Started|Development: Getting started]]: guidelines to start contributing to the project.
|-
* [[Qt_for_Python/Considerations| Considerations and known issues]]
| style="background: #fdfd96;text-align: center;" | 5.15.0    || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x || style="background: #ff6961;text-align: center;" | x
* [[Qt_for_Python/Reporting_Bugs|Reporting Bugs]]: report any issue related PySide2 or Shiboken2.
|-
* [https://codereview.qt-project.org/pyside/pyside-setup Git repository (Code review)] (5.12 branch is the branch currently worked on for PySide2) and [https://codereview.qt-project.org/#/q/project:%255Epyside.%252B,n,z PySide2 open patches]  
| style="background: #fdfd96;text-align: center;" | 5.15.1-7  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x || style="background: #ff6961;text-align: center;" | x
|-
| style="background: #fdfd96;text-align: center;" | 5.15.8    || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x || style="background: #ff6961;text-align: center;" | x
|-
| style="background: #fdfd96;text-align: center;" | 5.15.9-10  || style="background: #ff6961;text-align: center;" | x  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x || style="background: #ff6961;text-align: center;" | x
|-
| style="background: #fdfd96;text-align: center;" | 5.15.11-15 || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #ff6961;text-align: center;" | x || style="background: #ff6961;text-align: center;" | x
|-
| style="background: #fdfd96;text-align: center;" |  6.0.x    || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x || style="background: #ff6961;text-align: center;" | x
|-
| style="background: #fdfd96;text-align: center;" |  6.1.x    || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x || style="background: #ff6961;text-align: center;" | x
|-
| style="background: #fdfd96;text-align: center;" |  6.2.x    || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x || style="background: #ff6961;text-align: center;" | x
|-
| style="background: #fdfd96;text-align: center;" |  6.3.x    || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x || style="background: #ff6961;text-align: center;" | x
|-
| style="background: #fdfd96;text-align: center;" |  6.4.x    || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #ff6961;text-align: center;" |  x || style="background: #ff6961;text-align: center;" | x
|-
| style="background: #fdfd96;text-align: center;" |  6.5.x    || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #ff6961;text-align: center;" | x || style="background: #ff6961;text-align: center;" | x
|-
| style="background: #fdfd96;text-align: center;" |  6.6.x    || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o || style="background: #ff6961;text-align: center;" | x
|-
| style="background: #fdfd96;text-align: center;" |  6.7.x    || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o || style="background: #ff6961;text-align: center;" | x
|-
| style="background: #fdfd96;text-align: center;" |  6.8.x    || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #ff6961;text-align: center;" | x  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o  || style="background: #77dd77;text-align: center;" | o || style="background: #77dd77;text-align: center;" | o
|}
 
 
==Getting Started==
 
*Refer to the [https://doc.qt.io/qtforpython/ '''official documentation'''] over the wiki for guides on getting started, tutorials, and more!.
 
*[https://doc.qt.io/qtforpython-6/gettingstarted/index.html Getting started] | [[Qt_for_Python/GettingStarted|wiki]]: download, build and install instructions.
*[https://doc.qt.io/qtforpython/tutorials/portingguide/index.html Porting docs] | [[Qt_for_Python/Porting_guide|wiki]]: Porting an existing Qt/C++ application to Qt/Python the porting process.
*[https://doc.qt.io/qtforpython/tutorials/index.html Tutorials] | [[Qt_for_Python/Tutorial|wiki]]: get started developing PySide applications.
*[https://doc.qt.io/qtforpython/shiboken6/ Shiboken] | [[Qt_for_Python/Shiboken|wiki]]: general information about the Python binding generator.
*[[Qt_for_Python/Development_Getting_Started|Development: Getting started]]: guidelines to start contributing to the project.
*[[Qt_for_Python/Considerations| Considerations and known issues]]
*[[Qt_for_Python/Reporting_Bugs|Reporting Bugs]]: report any issue related PySide6 or Shiboken6.
*[http://code.qt.io/cgit/pyside/pyside-setup.git/ Git repository (Code review)] (dev branch is the branch currently worked on for PySide6) and [https://codereview.qt-project.org/#/q/project:%255Epyside.%252B,n,z PySide6 open patches]


== Community ==
==Community==


* Official '''IRC channel''' on [https://freenode.net/ Freenode] '''#qt-pyside'''
*[http://lists.qt-project.org/mailman/listinfo/pyside Official Mailing list]
* [http://lists.qt-project.org/mailman/listinfo/pyside Official Mailing list]
*Qt Forum: [https://forum.qt.io/category/58/qt-for-python Qt for Python Subcategory]
* Keybase:
*[[Qt_for_Python/Suggestions|Have an idea? share it with us!]]
** [https://keybase.io/team/pyside keybase.io/team/pyside]
** [https://keybase.io/team/pyside keybase.io/team/theqtcompany] (subteam ''theqtcompany.pyside'')
* Gitter: [http://gitter.im/PySide/pyside2 gitter.im/PySide/pyside2] (including bot that bridges IRC)
* [[Qt_for_Python/Suggestions|Have an idea? share it with us!]]


== Development Status ==
The following '''chat platforms''' are connected via a bridge, so independent of the one you join, you will get the messages from the other ones.


* [[Qt_for_Python_Development_Notes|Development Notes by date]]: the summary of the development progress.
*Official '''IRC channel''' on [https://libera.chat/ Libera.chat] '''#qt-pyside'''
* '''Qt for Python Development Progress Notes''' The most current view of the progress can be found in Jira: [https://bugreports.qt.io/secure/IssueNavigator.jspa?mode=hide&requestId=17825 Unresolved issues] and [https://bugreports.qt.io/secure/IssueNavigator.jspa?mode=hide&requestId=18025 All issues (including resolved)]. The second link is useful to monitor the progress of the backlog. The best way to achieve this is to sort the list by the "Updated" column. Larger backlog/feature items are filed as "User Stories" in Jira.
*Gitter: [http://gitter.im/PySide/pyside2 gitter.im/PySide/pyside2] (even if the url contains 'pyside2' it includes 'pyside6' discussion as well)
* [[Qt_for_Python_Missing_Bindings|Missing PySide2 bindings]]: the list of the current missing bindings.
*Matrix/Riot: [https://webchat.kde.org/#/room/#qt-pyside:kde.org #qt-pyside:kde.org]
*Telegram Group: [https://t.me/qtforpython Qt for Python]


== Frequently Asked Questions ==
==Development Status==


* Q: PySide? Qt for Python? what is the name?
*[[Qt_for_Python_Development_Notes|Development Notes by date]]: the summary of the development progress.
** A: The name of the project is '''Qt for Python''' and the name of the module is '''PySide2'''.
*'''Qt for Python Development Progress Notes''' The most current view of the progress can be found in Jira: [https://bugreports.qt.io/secure/IssueNavigator.jspa?mode=hide&requestId=17825 Unresolved issues] and [https://bugreports.qt.io/secure/IssueNavigator.jspa?mode=hide&requestId=18025 All issues (including resolved)]. The second link is useful to monitor the progress of the backlog. The best way to achieve this is to sort the list by the "Updated" column. Larger backlog/feature items are filed as "User Stories" in Jira.
* Q: Why PySide2 and not just PySide?
*[[Qt_for_Python_Missing_Bindings|Missing PySide6 bindings]]: the list of the current missing bindings.
** A: Since PySide was developed for Qt4, when the port was made to support Qt5, the name was changed to PySide2 to imply that it was a newer version.
* Q: Where I can find information about the old PySide project?
** A: The old wiki page of the project is available on [[PySide]], '''but''' the project is deprecated and there is no official support for it. We highly recommend not to use it.
* Q: My project is using PySide, how hard would it be to adapt it to PySide2?
** A: The changes are the same as between [https://doc.qt.io/qt-5/qt5-intro.html Qt4 and Qt5], and for PySide users it mostly means adapting the ''import'' statements since many classes were moved from QtGui to QtWidgets.
::''Qt 5 is highly compatible with Qt 4. It is possible for developers of Qt 4 applications to seamlessly move to Qt 5 with their current functionality and gradually develop new things, leveraging all the great items Qt 5 makes possible.''
* Q: Does PySide2 support Android and iOS development / deployment?
** At the moment there is no support for mobile platforms. It will be looked into in the future.
* Q: Does PySide2 have support for embedded Linux (Raspberry Pi, i.MX6 etc)?
** Not at the moment. It will be looked into in the future.
* Q: There are three wheels ('''pyside2''', '''shiboken2''', and '''shiboken2_generator''') what is the different between them?
** Before the official release, everything was in one big wheel, but it made sense to split the projects in three different wheels:
*** '''pyside2''': contains all the PySide2 module for all the Qt libraries. Also depends on the ''shiboken2'' module.
*** '''shiboken2''': contains the shiboken2 module with helper functions for PySide2.
*** '''shiboken2_generator''': contains the generator binary that can work with a C++ project and a typesystem to generate Python bindings. Take into account that if you want to generate bindings for a Qt/C++ project, the linking to the Qt shared libraries will be missing, and you will need to do this by hand. We recommend to build PySide2 from scratch to have everything properly linked.
* Q: Why '''shiboken2_generator''' is not installed automatically?
** It's not necessary to install it to use PySide2. The package is the result of the [https://bugreports.qt.io/browse/PYSIDE-749 wheel splitting process]. To use the generator it's recommended to build it from scratch to have the proper Qt-linking.


== Contributing to the Qt for Python Wiki ==
==Contributing to the Qt for Python Wiki==


This Wiki is a community area where you can easily contribute, and which may contain rapidly changing information.
This Wiki is a community area where you can easily contribute, and which may contain rapidly changing information.
Please put any wiki pages related to Qt for Python into the "QtForPython" category by adding the following text to the top of the page:
Please put any wiki pages related to Qt for Python into the "QtForPython" category by adding the following text to the top of the page:
<code>
<nowiki>
[[Category:Qt for Python]]
[[Category:Qt for Python]]
</code>
</nowiki>


When creating a new wiki page, please start the name with the prefix "Qt_for_Python/", so all the wiki page names will have the same structure and breadcrumbs are generated for easier navigation.
When creating a new wiki page, please start the name with the prefix "Qt_for_Python/", so all the wiki page names will have the same structure and breadcrumbs are generated for easier navigation.

Latest revision as of 08:49, 17 October 2024

En Ar Bg De El Es Fa Fi Fr Hi Hu It Ja Kn Ko Ms Nl Pl Pt Ru Sq Th Tr Uk Zh

Qt for Python

Qt for Python official logo.

The Qt for Python project aims to provide a complete port of the PySide module to Qt. The development started on GitHub in May 2015. The project managed to port PySide to Qt 5.3, 5.4 & 5.5. During April 2016 The Qt Company decided to properly support the port (see details ).

The module was released mid June 2018 as a Technical Preview (supporting Qt 5.11), and it was officially released without the Technical Preview tag, in December 2018 for Qt 5.12. In December 2020, the module was released for Qt6, which is the latest available version, which has the following differences:

  • It doesn't support Python 2.7,
  • Dropped support for Python 3.5, keeping 3.6+ only until PySide 6.3
  • PySide 6.4 is the first version that supports Python 3.7+

This wiki page tracks the progress of the Qt for Python project development and provides further information concerning the effort.

Qt for Python is available under LGPLv3/GPLv2 and commercial license for the following platforms:

Linux macOS Windows
i386 amd64 arm64 32bit 64bit Apple Silicon 32bit 64bit
Python 3.7+ ⦿
  • ⁜ Partially supported via cross compilation
  • ✸ No Qt Support https://doc.qt.io/qt-6/supported-platforms.html
  • ☆ Not supported / No packages
  • ⦿ Supported from 6.2.2 / Can be built from source
  • ✦: 5.14 is the first version to support Python 3.8, but Python 3.8.0 will not work on Windows. Please use Python 3.8.1 or greater.
  • Please notice that iOS, and WebAssembly are not supported yet.


Get PySide6 via pip by running: pip install pyside6

Pyside6 install.gif

What does it look like?

Code Application
import sys
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QApplication, QLabel
                                                     
if __name__ == "__main__":
    app = QApplication(sys.argv)
    label = QLabel("Hello World", alignment=Qt.Alignment.AlignCenter)
    label.show()
    sys.exit(app.exec())

2020-12-16-101334 305x245 scrot.png

More examples can be found in the project's repository inside the examples directory.

Python compatibility matrix

2.7 3.5 3.6 3.7 3.8 3.9 3.10 3.11 3.12 3.13
5.15.0 o o o o o x x x x x
5.15.1-7 o o o o o o x x x x
5.15.8 o o o o o o o x x x
5.15.9-10 x o o o o o o x x x
5.15.11-15 x x o o o o o o x x
6.0.x x x o o o o x x x x
6.1.x x x o o o o x x x x
6.2.x x x o o o o o x x x
6.3.x x x o o o o o x x x
6.4.x x x x o o o o o x x
6.5.x x x x o o o o o x x
6.6.x x x x x o o o o o x
6.7.x x x x x x o o o o x
6.8.x x x x x x o o o o o


Getting Started

Community

The following chat platforms are connected via a bridge, so independent of the one you join, you will get the messages from the other ones.

Development Status

  • Development Notes by date: the summary of the development progress.
  • Qt for Python Development Progress Notes The most current view of the progress can be found in Jira: Unresolved issues and All issues (including resolved). The second link is useful to monitor the progress of the backlog. The best way to achieve this is to sort the list by the "Updated" column. Larger backlog/feature items are filed as "User Stories" in Jira.
  • Missing PySide6 bindings: the list of the current missing bindings.

Contributing to the Qt for Python Wiki

This Wiki is a community area where you can easily contribute, and which may contain rapidly changing information. Please put any wiki pages related to Qt for Python into the "QtForPython" category by adding the following text to the top of the page: [[Category:Qt for Python]]

When creating a new wiki page, please start the name with the prefix "Qt_for_Python/", so all the wiki page names will have the same structure and breadcrumbs are generated for easier navigation.