How to use the qtawesome.animation.Spin function in QtAwesome

To help you get started, we’ve selected a few QtAwesome examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spyder-ide / qtawesome / qtawesome / animation.py View on Github external
if self.parent_widget not in self.info:
            timer = QTimer()
            timer.timeout.connect(self._update)
            self.info[self.parent_widget] = [timer, 0, self.step]
            timer.start(self.interval)
        else:
            timer, angle, self.step = self.info[self.parent_widget]
            x_center = rect.width() * 0.5
            y_center = rect.height() * 0.5
            painter.translate(x_center, y_center)
            painter.rotate(angle)
            painter.translate(-x_center, -y_center)


class Pulse(Spin):

    def __init__(self, parent_widget):
        super().__init__(parent_widget, interval=300, step=45)