from PySide2.QtWidgets import QApplication, QLabel, QWidget app = QApplication([]) label = QLabel('Hello World!') label.show() app.exec_()
from PySide2.QtGui import QPixmap from PySide2.QtWidgets import QApplication, QLabel, QWidget app = QApplication([]) label = QLabel() pixmap = QPixmap('example.png') label.setPixmap(pixmap) label.show() app.exec_()
from PySide2.QtWidgets import QApplication, QLabel, QWidget app = QApplication([]) html = 'In conclusion, PySide2.QtWidgets QLabel is a useful widget for displaying text, images and HTML content in a GUI application.Heading
Paragraph
' label = QLabel() label.setText(html) label.show() app.exec_()