Giter Club home page Giter Club logo

pyqt-timer-label's Introduction

pyqt-timer-label

PyQt QLabel adapted to timer feature

Requirements

  • PyQt5 >= 5.8

Setup

python -m pip install pyqt-timer-label

Included Packages

Detailed Description

You can set start hour/min/sec. Same to end. You can use this when you want to make a timer label which follows hh:mm:ss format. By the way, default end time is 00:00:00. You can change it with methods i'll explain below.

Method, Signal Overview

  • setStartHour(h: int), setStartMinute(m: int), setStartSecond(s: int). Same to end.
  • setTimerReverse(f: bool) to make timer go reversed. Default is True, which means subtracts one second.
  • There are useful methods like start(), pause(), restart(), refresh(), reset(), stop() as well as useful signals like doubleClicked, prepared, started, paused, restarted, refreshed, resetSignal, stopped.
  • isPaused() -> bool - Check if the timer being paused or not

Example

Code Sample

from PyQt5.QtWidgets import QApplication, QWidget, QGridLayout
from pyqt_timer_label import TimerLabel


if __name__ == "__main__":
    import sys

    app = QApplication(sys.argv)
    lbl = TimerLabel()
    lbl.setStartHour(0)
    lbl.setStartMinute(0)
    lbl.setStartSecond(15)
    widget = QWidget()
    lay = QGridLayout()
    lay.addWidget(lbl)
    widget.setLayout(lay)
    widget.show()
    lbl.start()
    sys.exit(app.exec_())

Start time is 00:00:15. End time is by default so it is 00:00:00.

Result

pyqt_timer_label_example.mp4

Note: I started recording from 12 seconds approximately. Preparation for recording took time so the result shows from the moment which indicates 9 seconds left.

See Also

pyqt-timer-label's People

Contributors

yjg30737 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.