def resizeEvent(self, event):
        """Override from QAbstractScrollArea.
        Resize the viewer widget when the viewport is resized."""
        vp = self.viewport()
        rect = vp.geometry()
        x1, y1, x2, y2 = rect.getCoords()
        width = x2 - x1 + 1
        height = y2 - y1 + 1

        self.v_w.resize(width, height)
def resizeEvent ( self , event ) : vp = self . viewport ( ) rect = vp . geometry ( ) x1 , y1 , x2 , y2 = rect . getCoords ( ) width = x2 - x1 + 1 height = y2 - y1 + 1 self . v_w . resize ( width , height )
Override from QAbstractScrollArea.
        Resize the viewer widget when the viewport is resized.