效果图如下
代码如下:
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 = QLabel(subtitle

这篇博客展示了如何在PyQT中对QlistWidget进行静态设计,提供了实现效果的截图,并给出了使用qtpy库(兼容PyQt5和PyQt4)的代码示例。
最低0.47元/天 解锁文章
4858

被折叠的 条评论
为什么被折叠?



