PySide6
PySide6 is the official Python module of the Qt for Python project. The module exposes the complete Qt framework, a C++ toolkit for desktop and mobile interfaces, to Python code. Its PyPI wheel includes the Qt libraries, which spares a project from installing Qt on its own. An app creates a QApplication, shows widgets such as a QLabel, then calls app.exec() to run the event loop, which waits for clicks and key presses. The Qt for Python project releases PySide6 under the LGPL. PyQt6 offers the same Qt classes under the GPL or a paid commercial license.
- Downloads / mo
- 4.2M
- Last release
- 6.12.0
- License
- LGPL / GPL
Strengths
- Qt comes in the wheel. pip install pyside6 brings the Qt binaries, so Qt needs no separate install.
- Visual form designer. Lay out Qt Widgets forms by drag and drop in pyside6-designer.
Limitations
- iOS builds need Xcode. Build and sign the generated iOS project in Xcode.
Quickstart
import sys from PySide6.QtWidgets import QApplication, QLabel app = QApplication(sys.argv) label = QLabel("Hello World!") label.show() app.exec()
PySide6 examples
def _setUpUi(self, title, content, parent): self.content = content self.titleLabel = QLabel(title, parent) self.contentLabel = BodyLabel(content, parent) self.buttonGroup = QFrame(parent) self.yesButton = PrimaryPushButton(self.tr('OK'), self.buttonGroup) self.cancelButton = QPushButton(self.tr('Cancel'), self.buttonGroup) self.vBoxLayout = QVBoxLayout(parent) self.textLayout = QVBoxLayout() self.buttonLayout = QHBoxLayout(self.buttonGroup) self.__initWidget()