def __init__(self, parent, statusbar):
        """Status bar widget base for widgets that update based on timers."""
        self.timer = None  # Needs to come before parent call
        super(BaseTimerStatus, self).__init__(parent, statusbar)
        self._interval = 2000

        # Widget setup
        fm = self.label_value.fontMetrics()
        self.label_value.setMinimumWidth(fm.width('000%'))

        # Setup
        if self.is_supported():
            self.timer = QTimer()
            self.timer.timeout.connect(self.update_status)
            self.timer.start(self._interval)
        else:
            self.hide()
def __init__ ( self , parent , statusbar ) : self . timer = None super ( BaseTimerStatus , self ) . __init__ ( parent , statusbar ) self . _interval = 2000 fm = self . label_value . fontMetrics ( ) self . label_value . setMinimumWidth ( fm . width ( '000%' ) ) if self . is_supported ( ) : self . timer = QTimer ( ) self . timer . timeout . connect ( self . update_status ) self . timer . start ( self . _interval ) else : self . hide ( )
Status bar widget base for widgets that update based on timers.