PySide explained

PySide
Author:The Qt Company (as part of Nokia)
Developer:The Qt Company
Released:[1]
Latest Release Version:6.6.2
Latest Release Date:[2]
Programming Language:Python
Operating System:Linux/X11, macOS, Windows
License:LGPL

PySide is a Python binding of the cross-platform GUI toolkit Qt developed by The Qt Company, as part of the Qt for Python project. It is one of the alternatives to the standard library package Tkinter. Like Qt, PySide is free software. PySide supports Linux/X11, macOS, and Microsoft Windows. The project can also be cross compiled to embedded systems like Raspberry Pi,[3] [4] and Android devices.[5]

History

By 2009, Nokia, the then owners of the Qt toolkit, wanted Python binding available under the LGPL license. Nokia failed to reach an agreement with Riverbank Computing the developers of PyQt Python binding.[6] In August, Nokia released PySide. It provided similar functionality, but under the LGPL.[7] [8] 'Side' is Finnish for binding.

There have been three major versions of PySide:[9]

PySide version 1 was released in August 2009 under the LGPL by Nokia, then the owner of the Qt toolkit, after it failed to reach an agreement with PyQt developers Riverbank Computing[10] to change its licensing terms to include LGPL as an alternative license. It supported Qt 4 under the operating systems Linux/X11, Mac OS X, Microsoft Windows, Maemo and MeeGo,[11] while the PySide community added support for Android.[12]

PySide2 was started by Christian Tismer to port PySide from Qt 4 to Qt 5 in 2015.[13] The project was then folded into the Qt Project.[14] It was released in December 2018.[13]

PySide6 was released in December 2020. It added support for Qt 6 and removed support for all Python versions older than 3.6.[9]

The project started out using Boost.Python from the Boost C++ libraries for the bindings. It later created its own binding generator named Shiboken,[15] to reduce the size of the binaries and the memory footprint.[16]

Hello, World! example

  1. Import PySide6 classes

import sysfrom PySide6 import QtCore, QtWidgets

  1. Create a Qt application

app = QtWidgets.QApplication(sys.argv)

  1. Create a Window

mywindow = QtWidgets.QWidgetmywindow.resize(320, 240)mywindow.setWindowTitle('Hello, World!')

  1. Create a label and display it all together

mylabel = QtWidgets.QLabel(mywindow)mylabel.setText('Hello, World!')mylabel.setGeometry(QtCore.QRect(200, 200, 200, 200))

mywindow.show

  1. Enter Qt application main loop

sys.exit(app.exec)

See also

External links

Notes and References

  1. Web site: PySide has been released . August 18, 2009 . PySide – Python for Qt . https://web.archive.org/web/20091025170910/http://www.pyside.org/2009/08/pyside-has-been-released/ . October 25, 2009 .
  2. Web site: PySide6 Release History. Python Package Index.
  3. Web site: Qt for Python Cross compilation . Qt . The Qt Company . April 13, 2022.
  4. Web site: Qt for Python details on the new 6.3 release . Qt . The Qt Company . April 13, 2022.
  5. Web site: Taking Qt for Python to Android . Qt . The Qt Company . April 13, 2022.
  6. Web site: faq . Martin Fitzpatrick Last updated . 2019-06-21 . PyQt5 vs PySide2: What's the difference between the two Python Qt libraries? . 2022-06-25 . Python GUIs . en-us.
  7. Web site: FAQ – PySide – Python for Qt . 2009-09-03 . Pyside.org . 2012-01-11 . https://web.archive.org/web/20120111134407/http://www.pyside.org/faq/ . dead .
  8. Web site: 2009-08-18 . PySide has been released – PySide – Python for Qt . dead . https://web.archive.org/web/20091025170910/http://www.pyside.org/2009/08/pyside-has-been-released/ . 2009-10-25 . 2009-09-03 . Pyside.org.
  9. Web site: Qt for Python 6 released . Cristián . Maureira-Fredes . Qt . The Qt Company . December 10, 2020.
  10. Web site: PySide FAQ . Qt Wiki . July 31, 2017 . February 24, 2021.
  11. Web site: PySide Downloads . Qt Wiki . February 16, 2018 . February 24, 2021.
  12. Web site: PySide for Android guide . Qt Wiki . February 26, 2018 . February 24, 2021.
  13. Web site: Qt for Python . Qt Wiki . December 16, 2020 . February 24, 2021.
  14. Web site: Bringing pyside back to Qt Project . Lars . Knoll . Christian . Tismer . pyside-dev Google Group . April 11, 2016 . February 24, 2021.
  15. Web site: Shiboken . Qt Documentation . The Qt Company . February 24, 2021.
  16. Web site: PySide Shiboken FAQ . Qt Wiki . June 5, 2016 . February 24, 2021.