def __init__(self, parent=None):
super(Chart, self).__init__(parent)
def paintEvent(self, Event):
paint.
setBrush(QtGui.
QColor("#808080")) paint.drawRect(40, 20, 580, 410)
paint.
setPen(QtGui.
QPen(QtGui.
QColor("#ffffff"),
1)) grad.
setColorAt(0.0, QtGui.
QColor("#fefdc5")) grad.
setColorAt(1.0, QtGui.
QColor("#f3c169")) paint.
setBrush(QtGui.
QBrush(grad
)) paint.drawRect(70, 430, 25, -100)
class Chart(QtGui.QWidget):
def __init__(self, parent=None):
super(Chart, self).__init__(parent)
def paintEvent(self, Event):
paint = QtGui.QPainter(self)
paint.setBrush(QtGui.QColor("#808080"))
paint.drawRect(40, 20, 580, 410)
paint.setPen(QtGui.QPen(QtGui.QColor("#ffffff"), 1))
grad = QtGui.QLinearGradient(0, 20, 0, 410)
grad.setColorAt(0.0, QtGui.QColor("#fefdc5"))
grad.setColorAt(1.0, QtGui.QColor("#f3c169"))
paint.setBrush(QtGui.QBrush(grad))
paint.drawRect(70, 430, 25, -100)
To copy to clipboard, switch view to plain text mode
Bookmarks