PyQt6
Python bindings for Qt desktop application framework.
Quick Start
import sys; from PyQt6.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout, QLabel
class MainWindow(QWidget):
def __init__(self):
super().__init__(); self.setWindowTitle("My App"); layout = QVBoxLayout()
self.label = QLabel("Hello!"); button = QPushButton("Click Me"); button.clicked.connect(self.on_click)
layout.addWidget(self.label); layout.addWidget(button); self.setLayout(layout)
def on_click(self): self.label.setText("Clicked!")
app = QApplication(sys.argv); w = MainWindow(); w.show(); sys.exit(app.exec())
When to Use
- Cross-platform desktop apps; Data analysis tools with GUI; Internal business apps
Validation
- Window displays all widgets; 2. Signals/slots work; 3. Layouts resize correctly