MCPcopy Index your code
hub / github.com/PyQt5/PyQt / Label

Class Label

QLabel/QtNinePatch2.py:25–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23
24
25class Label(QLabel):
26
27 def __init__(self, *args, **kwargs):
28 super(Label, self).__init__(*args, **kwargs)
29 # .9 格式的图片
30 self.image = QImage('Data/skin_aio_friend_bubble_pressed.9.png')
31
32 def showEvent(self, event):
33 super(Label, self).showEvent(event)
34 pixmap = QtNinePatch2.createPixmapFromNinePatchImage(
35 self.image, self.width(), self.height())
36 self.setPixmap(pixmap)
37
38 def resizeEvent(self, event):
39 super(Label, self).resizeEvent(event)
40 pixmap = QtNinePatch2.createPixmapFromNinePatchImage(
41 self.image, self.width(), self.height())
42 self.setPixmap(pixmap)
43
44
45app = QApplication(sys.argv)

Callers 1

QtNinePatch2.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected