Source code for prettyqt.core.timer

# -*- coding: utf-8 -*-
"""
@author: Philipp Temminghoff
"""

from qtpy import QtCore

from prettyqt import core


QtCore.QTimer.__bases__ = (core.Object,)


[docs]class Timer(QtCore.QTimer): @classmethod def single_shot(cls, callback): timer = cls() timer.timeout.connect(callback) timer.setSingleShot(True) return timer