from PySide2.QtWidgets import QApplication, QLabel, QWidget app = QApplication([]) widget = QWidget() label = QLabel("Hello, World!", widget) label.move(50, 50) widget.show() app.exec_()
from PySide2.QtGui import QPixmap from PySide2.QtWidgets import QApplication, QLabel, QWidget app = QApplication([]) widget = QWidget() pixmap = QPixmap("image.jpg") label = QLabel(widget) label.setPixmap(pixmap) label.move(50, 50) widget.show() app.exec_()In this example, a QLabel is created with an image "image.jpg" using the PySide2.QtGui.QPixmap class. The label is then moved to position (50, 50) using the 'move' method. Package library: PySide2.