Learn Python PyQt

What is PyQt?

PyQt connects the Qt C++ cross-platform framework with the Python language, it is a GUI module.

Qt is more than a GUI toolkit, which is why it features abstractions of network sockets or threads, along with Unicode, SQL, databases, SVG, OpenGL, XML, an operational we browser, a service system and a vast array of GUI widgets.

The principle on which a Qt class functions is related to a slot mechanism responsible for offering communication between items with the purpose of designing re-usable software components with ease.

Also, Qt comes with Qt Designer, a tool that acts as a graphical user interface. PyQt can design Python code from Qt Designer, while adding new GUI controls when both Qt Designer and Python programming language are used.

Book: Create Desktop Apps with Python PyQt5

PyQt classes

PyQt’s classes are classified into distinct modules, as it follows:

  • QtCore: The QtCore setting features the core non-GUI functionality, being employed for items such as time, files, directories, distinct data types, threads or processes.
  • QtGui: The QtGui features graphical components and related classes, such as buttons, windows, status bars, bitmaps, colours or fonts.
  • QtNetwork: The QtNetwork is meant to be used for network programming purposes and it eases the coding of TCP/ IP and UDP clients or servers.
  • QtXml: The QtXml servers the purposes of working with XML files, offering implementation for SAX and DOM APIs.
  • QtSvg: The QtSvg features classes for revealing the contents of SVG files, SVG being a language meant to describe two-dimenl graphics or graphical applications in XML
  • QtOpenGL: The QtOpenGL is meant for rendering both 3D and 2D graphics via the OpenGL library.
  • QtSql: The QtSql offers means for working with databases.