I made a simple first application on python, everything would be fine, but the resizeEvent function is loaded and because of that when scaling the window it slows down, the fact is that this function has such code:
def resizeEvent(self, event): self.lbl.setGeometry(QRect(0, 0, self.width(), self.height())) self.lbl.setPixmap(QPixmap(":/img/background.png").scaled(self.width(), self.height(), Qt.KeepAspectRatio, transformMode=Qt.SmoothTransformation)) for example, I show only the first 2 lines, then they are repeated 12 times, respectively, this is exactly what slows down the resize. Is it possible to somehow stretch the image to fit the window? Also at the end, the onActivated() function is onActivated() which checks the state of the checkbox and does its job:
def onActivated(self): if self.check1.isChecked(): self.lbl1.show() else: self.lbl1.hide() The same piece of code is repeated 12 times, under each label.