def resizeEvent(self, event): if self._overlay is None: return QScrollBar.resizeEvent(self, event) self._overlay.resize(self.size())