def addComponents(self): layout = QGridLayout() self.test1 = MTestComponent() cancel = QPushButton("Cancel Animation") cancel.clicked.connect(self.cancel_animation) layout.addWidget(self.test1) layout.addWidget(cancel) self.setLayout(layout)
def addComponents(self): layout = QGridLayout() self.test1 = MTestComponent() # self.test1.animate().fade(100).scale(50).start() cancel = QPushButton("Start Animation") cancel.clicked.connect(self.start_animation) layout.addWidget(self.test1) layout.addWidget(cancel) self.setLayout(layout)
class MainWindow(QWidget): def __init__(self): QWidget.__init__(self) self.setWindowTitle("Reveal test") self.setGeometry(100, 100, 500, 500) p = self.palette() p.setColor(self.backgroundRole(), MColors.BACKGROUND_DARK) self.setPalette(p) def addComponents(self): layout = QGridLayout() self.test1 = MTestComponent() cancel = QPushButton("Cancel Animation") cancel.clicked.connect(self.cancel_animation) layout.addWidget(self.test1) layout.addWidget(cancel) self.setLayout(layout) def cancel_animation(self): self.test1.trigger_cancel()
class MainWindow(QWidget): def __init__(self): QWidget.__init__(self) self.setWindowTitle("Reveal test") self.setGeometry(100, 100, 500, 500) p = self.palette() p.setColor(self.backgroundRole(), MColors.BACKGROUND_DARK) self.setPalette(p) def addComponents(self): layout = QGridLayout() self.test1 = MTestComponent() # self.test1.animate().fade(100).scale(50).start() cancel = QPushButton("Start Animation") cancel.clicked.connect(self.start_animation) layout.addWidget(self.test1) layout.addWidget(cancel) self.setLayout(layout) def start_animation(self): self.test1.animate().duration(1000).reveal("show").start()