def initUI(self):
self.mainLayout = QtWidgets.QVBoxLayout(self)
self.scrollArea = QtWidgets.QScrollArea(parent=self)
self.scrollArea.setWidgetResizable(True)
self.scrollArea.setFrameStyle(QtWidgets.QFrame.NoFrame)
self.scrollArea.setFrameShadow(QtWidgets.QFrame.Plain)
self.scrollWidget = QtWidgets.QWidget()
self.scrollLayout = flowlayout.FlowLayout()
self.scrollWidget.setLayout(self.scrollLayout)
self.scrollArea.setWidget(self.scrollWidget)
self.mainLayout.addWidget(self.scrollArea)
self.setLayout(self.mainLayout)
for i in iconlib.Icon.iconCollection:
colorRandom = (random.randrange(0, 255), random.randrange(0, 255), random.randrange(0, 255))
btn = QtWidgets.QToolButton(parent=self)
icon = iconlib.Icon.iconColorized(i, size=256, color=colorRandom)
btn.setIcon(icon)
btn.setText(i)
btn.clicked.connect(self.copyNameToClipboard)
self.scrollLayout.addWidget(btn)
评论列表
文章目录