'Disabling PyQt5 window shadow

There is a very annoying kind of shadow/frame over my PyQt5 window. The window is made as a custom class:

class CustomWindow(QMainWindow):
    def __init__(self):
        super(CustomWindow,self).__init__()
        self.bg = '#FFFFFF'
        self.opacity =1 

    def paintEvent(self, event=None):
        painter = QPainter(self)

        painter.setOpacity(self.opacity)
        painter.setBrush(QColor(self.bg))
        painter.setPen(QPen(QColor(0,0,0)))   
        painter.drawRect(self.rect())

    def config(self, bg, op):
        self.bg = bg
        self.opacity = op

The shadow thing I'm talking about:

IMAGE

You can see that there are thin black lines on the left and upper edges of the window. Does anyone know how to disable them?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source