Difference between revisions of "Qt for Python"

From Qt Wiki
Jump to: navigation, search
m (Frequently Asked Questions)
 
(29 intermediate revisions by 6 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 ==
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.
+
[[File:Py-128.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 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] ).
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 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.
  
 
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 GPL, LGPL and commercial license.
+
'''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:
  
== Getting Started ==
+
{| class="wikitable"
* [https://doc-snapshots.qt.io/qtforpython/ Official documentation] (snapshot)
+
| - |
* [[Qt_for_Python/GettingStarted|Getting started guide for macOS, Windows and Linux]] '''(Download and Install/Build)'''
+
! colspan="2" style="background: #aec6cf;text-align: center;" |Linux
* [[Qt_for_Python/Tutorial|Tutorials]]
+
! colspan="2" style="background: #aec6cf;text-align: center;" |macOS
* [[Qt_for_Python/Development_Getting_Started|Development: Getting started]]
+
! colspan="2" style="background: #aec6cf;text-align: center;" |Windows
* [[Qt_for_Python/Reporting_Bugs|Reporting Bugs]] to report any issue.
+
|-
* [https://codereview.qt-project.org CodeReview] and [https://codereview.qt-project.org/#/q/project:%255Epyside.%252B,n,z PySide2 open patches]  
+
| |
* Git repository (5.11 branch is the branch currently worked on for PySide2)
+
| style="background: #fdfd96;text-align: center;" |32bit
** ssh://codereview.qt-project.org/pyside/pyside-setup
+
| style="background: #ffb347;text-align: center;" |64bit
 +
| style="background: #fdfd96;text-align: center;" |32bit
 +
| style="background: #ffb347;text-align: center;" |64bit
 +
| 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: #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: #ff6961;text-align: center;" | **
 +
|-
 +
| style="background: #aec6cf;text-align: center;" |'''Python 3.5+'''
 +
| 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: #77dd77;text-align: center;" |
 +
| style="background: #77dd77;text-align: center;" |
 +
|}
 +
 
 +
<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="font-family: monospace;background-color: #cecfd5;display: inline; border-radius: 4px;padding: 3px;">pip install PySide2</span>
  
== What does '''Qt for Python''' look like? ==  
+
=== What does it look like? ===
  
 
<syntaxhighlight lang="python" line="line">
 
<syntaxhighlight lang="python" line="line">
Line 36: Line 61:
  
 
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 ==
 +
* [https://doc.qt.io/qtforpython/ Official documentation]
 +
* [[Qt_for_Python/GettingStarted|Getting started guide for macOS, Windows and Linux]]: download, build and install instructions.
 +
* [[Qt_for_Python/Porting_guide|Porting an existing C++ application to PySide2]]: Highlights a few differences between C++ and Python and guides you through the porting process.
 +
* [[Qt_for_Python/Tutorial|Tutorials]]: get started developing PySide2 applications.
 +
* [[Qt_for_Python/Shiboken|Shiboken]]: 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 PySide2 or Shiboken2.
 +
* [http://code.qt.io/cgit/pyside/pyside-setup.git/ 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]
  
 
== Community ==
 
== Community ==
  
* Official IRC channel on FreeNode '''#qt-pyside'''
+
* 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]
 
* Keybase:
 
* Keybase:
 
** [https://keybase.io/team/pyside keybase.io/team/pyside]
 
** [https://keybase.io/team/pyside keybase.io/team/pyside]
 
** [https://keybase.io/team/pyside keybase.io/team/theqtcompany] (subteam ''theqtcompany.pyside'')
 
** [https://keybase.io/team/pyside keybase.io/team/theqtcompany] (subteam ''theqtcompany.pyside'')
* Gitter: [http://gitter.im/PySide/pyside2 gitter.im/PySide/pyside2]
+
* Gitter: [http://gitter.im/PySide/pyside2 gitter.im/PySide/pyside2] (including bot that bridges IRC)
 +
* Matrix/Riot: '''#qt-pyside:matrix.org''' (Qt for Python)
 
* [[Qt_for_Python/Suggestions|Have an idea? share it with us!]]
 
* [[Qt_for_Python/Suggestions|Have an idea? share it with us!]]
  
 
== Development Status ==
 
== Development Status ==
  
=== Weekly development progress ===
+
* [[Qt_for_Python_Development_Notes|Development Notes by date]]: the summary of the development progress.
The summary of the development progress can be found in [https://wiki.qt.io/Qt_for_Python_Development_Notes Development Notes by date]
+
* '''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.
 
+
* [[Qt_for_Python_Missing_Bindings|Missing PySide2 bindings]]: the list of the current missing bindings.
=== Pyside 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]
 
# [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.
 
 
 
=== Missing PySide2 bindings ===
 
 
 
The list of the current missing bindings can be found in [[Qt_for_Python_Missing_Bindings|Missing PySide2 bindings]]
 
 
 
=== Outstanding tasks for release ===
 
 
 
# Determine PySide2 package number
 
# Ensure multi target packages can be created (long standing - reduced Python API usage )
 
# General Doc changes required for release
 
## Getting started
 
## Some examples documented
 
## pyinstaller usage
 
## Class documentation polish
 
## snapshot generation on http://doc-snapshot.qt-project.org/
 
  
 
== Frequently Asked Questions ==
 
== Frequently Asked Questions ==
Line 90: Line 103:
 
* Q: Does PySide2 support Android and iOS development / deployment?
 
* 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.
 
** 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)?
== Known issues ==
+
** 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 difference between them?
* [[Qt_for_Python/Considerations| Considerations and known issues]]
+
** 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 ==

Latest revision as of 10:08, 26 June 2019

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 5. 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.

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
32bit 64bit 32bit 64bit 32bit 64bit
Python 2.7 * * ** **
Python 3.5+ * *

*: No Qt release.
**: MSVC issue with Python 2.7 and Qt

Get PySide2 via pip by running: pip install PySide2

What does it look like?

1 import sys
2 from PySide2.QtWidgets import QApplication, QLabel
3                                                      
4 if __name__ == "__main__":
5     app = QApplication(sys.argv)
6     label = QLabel("Hello World")
7     label.show()
8     sys.exit(app.exec_())

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

Getting Started

Community

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 PySide2 bindings: the list of the current missing bindings.

Frequently Asked Questions

  • Q: PySide? Qt for Python? what is the name?
    • A: The name of the project is Qt for Python and the name of the module is PySide2.
  • Q: Why PySide2 and not just PySide?
    • 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 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 difference 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 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

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.