效果图如下
代码如下:
from qtpy.QtWidgets import (QWidget, QLabel, QApplication, QPushButton, QVBoxLayout,
QHBoxLayout, QListWidget, QListWidgetItem)
from qtpy.QtCore import QSize, Qt
from qtpy.QtGui import QPixmap, QFont
import sys
class MyLable(QWidget):
""" a widget contains a picture and two line of text """
def __init__(self, title, subtitle, icon_path):
"""
:param title: str title
:param subtitle: str subtitle
:param icon_path: path of picture
"""
super(MyLable, self).__init__()
self.lb_title = QLabel(title)
self.lb_title.setFont(QFont("Arial", 10, QFont.Bold))
self.lb_subtitle