If you want to manually draw on the custom widget then you can override the paintEvent or use absolute positioning and place the rectangles where you want. The paintEvent might be better, but it is more complex. http://zetcode.com/gui/pyqt4/drawing/ example and http://pyqt.sourceforge.net/Docs/PyQt4/qpainter.html is the class reference. I wrote an example below.
def paintEvent(self, event):
super().paintEvent(event)
painter = QtGui.QPainter()
painter.begin(self)
rect = self.rect()
gradient = QtGui.QRadialGradient(rect.center(), rect.width())
gradient.setColorAt(0.0, QtGui.QColor(255, 255, 255, 10)
gradient.setColorAt(0.90, QtGui.QColor(0, 0, 0, 255))
gradient.setColorAt(0.98, QtGui.QColor(0, 0, 0, 100))
painter.setPen(QtGui.QColor(0, 0, 0) # Pen works on the border
painter.setBrush(grad) # Main color
# Draw the rectangle
painter.drawRect(rect) # Try to keep your rectangle within the widget area
painter.end()
event.accept()