how to show picture and text in a label (PyQt)
问题 I need to show a picture and text in a label, and this is my code: import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * class MyLabel(QLabel): def __init__(self): super(MyLabel, self).__init__() def paintEvent(self, QPaintEvent): pos = QPoint(50, 50) painter = QPainter(self) painter.drawText(pos, 'hello,world') painter.setPen(QColor(255, 255, 255)) class Window(QWidget): def __init__(self): super(Window, self).__init__() layout = QHBoxLayout(self) self