(...)
picture = "ui/snap/" + gamepicture
if not os.path.isfile(picture):
picture = "ui/pixmaps/nopic.png"
if gamestatus:
color
= QtGui.
QColor(0,
0,
0,
0) pix.fill(color)
rect
= QtCore.
QRectF(0.0,
0.0,
238,
174) painter.begin(pix)
painter.
setRenderHints(QtGui.
QPainter.
Antialiasing,
True) path.addRoundedRect(rect, 10.0, 10.0)
painter.drawPath(path)
brush.
setTexture(QtGui.
QPixmap(picture
)) painter.fillPath(path, brush)
painter.end()
pixItem = GameItem(gameid, pix, None, self.scene)
pixItem.setPos((260 * col), lin)
col += 1
if col >= 6:
lin += 220
col = 0
self.graphicsView.setScene(self.scene)
self.graphicsView.setAlignment(QtCore.Qt.AlignLeft)
(...)
(...)
picture = "ui/snap/" + gamepicture
if not os.path.isfile(picture):
picture = "ui/pixmaps/nopic.png"
if gamestatus:
color = QtGui.QColor(0, 0, 0, 0)
pix = QtGui.QPixmap(QtCore.QSize(238, 174))
pix.fill(color)
rect = QtCore.QRectF(0.0, 0.0, 238, 174)
painter = QtGui.QPainter()
painter.begin(pix)
painter.setRenderHints(QtGui.QPainter.Antialiasing, True)
path = QtGui.QPainterPath()
path.addRoundedRect(rect, 10.0, 10.0)
painter.drawPath(path)
brush = QtGui.QBrush()
brush.setTexture(QtGui.QPixmap(picture))
painter.fillPath(path, brush)
painter.end()
pixItem = GameItem(gameid, pix, None, self.scene)
pixItem.setPos((260 * col), lin)
col += 1
if col >= 6:
lin += 220
col = 0
self.graphicsView.setScene(self.scene)
self.graphicsView.setAlignment(QtCore.Qt.AlignLeft)
(...)
To copy to clipboard, switch view to plain text mode
Bookmarks