def __init__(self):
super().__init__()
self.setGeometry(600, 200, 420, 320)
self.setWindowTitle('Help')
self.setWindowIcon(QIcon(ICON_PATH))
label = QLabel('Press anything on your keyboard to see what it does.')
self.actionLabel = QLabel('Press something!')
self.img = QLabel('img', self)
self.img.setPixmap(QPixmap(HELP_IMG_PATH))
grid = QGridLayout()
grid.setSpacing(4)
grid.addWidget(self.img, 0, 0)
grid.addWidget(label, 1, 0)
grid.addWidget(self.actionLabel, 2, 0)
myFont=QFont()
myFont.setBold(True)
myFont.setPixelSize(24)
self.actionLabel.setFont(myFont)
palette = QPalette()
palette.setColor(QPalette.Foreground,Qt.green)
self.actionLabel.setPalette(palette)
self.setLayout(grid)
self.show()
评论列表
文章目录