PyQt

Last updated
PyQt
Developer(s) Riverbank Computing
Initial release1998
Stable release
6.6.1 [1]   OOjs UI icon edit-ltr-progressive.svg / 4 December 2023;3 months ago (4 December 2023)
Written in C++ / Python [2]
Operating system Cross-platform
License GNU GPL and commercial
Website riverbankcomputing.com

PyQt is a Python binding of the cross-platform GUI toolkit Qt, implemented as a Python plug-in. PyQt is free software developed by the British firm Riverbank Computing. It is available under similar terms to Qt versions older than 4.5; this means a variety of licenses including GNU General Public License (GPL) and commercial license, but not the GNU Lesser General Public License (LGPL). [3] PyQt supports Microsoft Windows as well as various kinds of UNIX, including Linux and MacOS (or Darwin). [4]

Contents

PyQt implements around 440 classes and over 6,000 functions and methods [5] including:

To automatically generate these bindings, Phil Thompson developed the tool SIP, which is also used in other projects.

History

PyQt was first released by Riverbank Computing in 1998. [8]

In August 2009, Nokia sought for the Python binding to be available under the LGPL license. At the time, Nokia owned Qt Software, the developer of QT. After failing to reach an agreement with Riverbank Computing, Nokia released its binding, PySide, providing similar functionality. [9]

Main components

Alternative PyQt logo Python and Qt 2.svg
Alternative PyQt logo

PyQt4 contains the following Python modules.

PyQt5 contains the following Python modules:

Versions

PyQt version 4 works with both Qt 4 and Qt 5. PyQt version 5 only supports Qt version 5, [4] and drops support for features that are deprecated in Qt 5. [11]

Hello World example

The result in KDE Plasma 4 PyQt screen.png
The result in KDE Plasma 4

The below code written for PyQt6 shows a small window on the screen.

#!/usr/bin/env python3"""Here we provide the necessary imports.The basic GUI widgets are located in QtWidgets module."""importsysfromPyQt6.QtWidgetsimportQApplication,QWidget# Every PyQt application must create an application object.# The application object is located in the QtWidgets module.app=QApplication([])# The QWidget widget is the base class of all user interface objects in PyQt.# We provide the default constructor for QWidget. The default constructor has no parent.# A widget with no parent is called a window.root=QWidget()root.resize(320,240)# The resize() method resizes the widget.root.setWindowTitle("Hello, World!")# Here we set the title for our window.root.show()# The show() method displays the widget on the screen.sys.exit(app.exec())# Finally, we enter the mainloop of the application.

Notable applications that use PyQt

See also

Related Research Articles

<span class="mw-page-title-main">Qt (software)</span> Object-oriented framework for software development

Qt is cross-platform software for creating graphical user interfaces as well as cross-platform applications that run on various software and hardware platforms such as Linux, Windows, macOS, Android or embedded systems with little or no change in the underlying codebase while still being a native application with native capabilities and speed.

wxWidgets Widget toolkit

wxWidgets is a widget toolkit and tools library for creating graphical user interfaces (GUIs) for cross-platform applications. wxWidgets enables a program's GUI code to compile and run on several computer platforms with minimal or no code changes. A wide choice of compilers and other tools to use with wxWidgets facilitates development of sophisticated applications. wxWidgets supports a comprehensive range of popular operating systems and graphical libraries, both proprietary and free, and is widely deployed in prominent organizations.

<span class="mw-page-title-main">Glade Interface Designer</span> Graphical user interface builder

Glade Interface Designer is a graphical user interface builder for GTK, with additional components for GNOME. In its third version, Glade is programming language–independent, and does not produce code for events, but rather an XML file that is then used with an appropriate binding. See List of language bindings for GTK for the available ones.

<span class="mw-page-title-main">PyGTK</span> Set of Python wrappers for the GTK graphical user interface library

PyGTK is a set of Python wrappers for the GTK graphical user interface library. PyGTK is free software and licensed under the LGPL. It is analogous to PyQt/PySide and wxPython, the Python wrappers for Qt and wxWidgets, respectively. Its original author is GNOME developer James Henstridge. There are six people in the core development team, with various other people who have submitted patches and bug reports. PyGTK has been selected as the environment of choice for applications running on One Laptop Per Child systems.

wxPython Python wrapper for wxWidgets

wxPython is a wrapper for the cross-platform GUI API wxWidgets for the Python programming language. It is one of the alternatives to Tkinter. It is implemented as a Python extension module.

eric (software) Python development environment

eric is a free integrated development environment (IDE) used for computer programming. Since it is a full featured IDE, it provides by default all necessary tools needed for the writing of code and for the professional management of a software project.

Tkinter is a Python binding to the Tk GUI toolkit. It is the standard Python interface to the Tk GUI toolkit, and is Python's de facto standard GUI. Tkinter is included with standard Linux, Microsoft Windows and macOS installs of Python.

<span class="mw-page-title-main">Scintilla (software)</span> Free and open text editor component

Scintilla is a free, open source library that provides a text editing component function, with an emphasis on advanced features for source code editing.

<span class="mw-page-title-main">QtJambi</span> Java bindings for Qt framework

QtJambi is a Java binding of the cross-platform application framework Qt. It enables Java developers to use Qt within the Java programming language. In addition, the QtJambi generator can be used to create Java bindings for other Qt libraries and future versions of Qt. Unlike GTK, there are no Swing LAF implementations that use Qt for rendering.

The following tables list notable software packages that are nominal IDEs; standalone tools such as source-code editors and GUI builders are not included. These IDEs are listed in alphabetic order of the supported language.

<span class="mw-page-title-main">Tk (software)</span> GUI toolkit or framework

Tk is a cross-platform widget toolkit that provides a library of basic elements of GUI widgets for building a graphical user interface (GUI) in many programming languages. It is free and open-source software released under a BSD-style software license.

Enthought, Inc. is a software company based in Austin, Texas, United States that develops scientific and analytic computing solutions using primarily the Python programming language. It is best known for the early development and maintenance of the SciPy library of mathematics, science, and engineering algorithms and for its Python for scientific computing distribution Enthought Canopy.

Web2py is an open-source web application framework written in the Python programming language. Web2py allows web developers to program dynamic web content using Python. Web2py is designed to help reduce tedious web development tasks, such as developing web forms from scratch, although a web developer may build a form from scratch if required.

<span class="mw-page-title-main">Qt Creator</span> QT development environment

Qt Creator is a cross-platform C++, JavaScript, Python and QML integrated development environment (IDE) which simplifies GUI application development. It is part of the SDK for the Qt GUI application development framework and uses the Qt API, which encapsulates host OS GUI function calls. It includes a visual debugger and an integrated WYSIWYG GUI layout and forms designer. The editor has features such as syntax highlighting and autocompletion. Qt Creator uses the C++ compiler from the GNU Compiler Collection on Linux. On Windows it can use MinGW or MSVC with the default install and can also use Microsoft Console Debugger when compiled from source code. Clang is also supported.


The Wing Python IDE is a family of integrated development environments (IDEs) from Wingware created specifically for the Python programming language, with support for editing, testing, debugging, inspecting/browsing, and error-checking Python code.

<span class="mw-page-title-main">PySide</span>

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, and Android devices.

SIP is an open source software tool used to connect computer programs or libraries written in C or C++ with the scripting language Python. It is an alternative to SWIG.

<span class="mw-page-title-main">Spyder (software)</span> IDE for scientific programming in Python

Spyder is an open-source cross-platform integrated development environment (IDE) for scientific programming in the Python language. Spyder integrates with a number of prominent packages in the scientific Python stack, including NumPy, SciPy, Matplotlib, pandas, IPython, SymPy and Cython, as well as other open-source software. It is released under the MIT license.

References

  1. Error: Unable to display the reference properly. See the documentation for details.
  2. "PyQt4 Download". Riverbankcomputing. 2010. Retrieved 2010-04-19.
  3. "Riverbank | Commercial | License FAQ". Riverbankcomputing.com. Retrieved 2015-06-24.
  4. 1 2 "What is PyQt?". Riverbank Computing. Retrieved 2014-09-18.
  5. "PyQt v4 - Python Bindings for Qt v4". Riverbankcomputing. Archived from the original on 2008-04-29. Retrieved 2010-04-17.
  6. "QSqlDatabase Class Reference". Pyqt.sourceforge.net. Retrieved 2014-09-25.
  7. PythonInfo Wiki
  8. Jarmul, Katharine; Lawson, Richard (2017-05-30). Python Web Scraping. Packt Publishing Ltd. p. 105. ISBN   978-1-78646-429-3.
  9. faq, Martin Fitzpatrick Last updated (2019-06-21). "PyQt5 vs PySide2: What's the difference between the two Python Qt libraries?". Python GUIs. Retrieved 2022-06-25.
  10. "Riverbank | Software | PyQt | What is PyQt?". Riverbankcomputing.co.uk. Retrieved 2010-04-15.
  11. "Differences Between PyQt4 and PyQt5", PyQt 5.3.2 Reference Guide, archived from the original on 2018-08-14, retrieved 2014-09-18

Further reading