Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yjg30737/pyqt-timer-label
PyQt QLabel for timer feature
https://github.com/yjg30737/pyqt-timer-label
pyqt pyqt-examples pyqt5 pyqt5-examples pyqt5-tutorial python python3 python37 qlabel qt qtime qtimer timer
Last synced: 14 days ago
JSON representation
PyQt QLabel for timer feature
- Host: GitHub
- URL: https://github.com/yjg30737/pyqt-timer-label
- Owner: yjg30737
- License: mit
- Created: 2022-02-16T02:05:56.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-12T10:04:32.000Z (almost 3 years ago)
- Last Synced: 2024-12-27T09:35:41.792Z (about 2 months ago)
- Topics: pyqt, pyqt-examples, pyqt5, pyqt5-examples, pyqt5-tutorial, python, python3, python37, qlabel, qt, qtime, qtimer, timer
- Language: Python
- Homepage:
- Size: 46.9 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pyqt-timer-label
PyQt QLabel adapted to timer feature## Requirements
* PyQt5 >= 5.8## Setup
`python -m pip install pyqt-timer-label`## Included Packages
* pyqt-responsive-label - for auto-resize the font of label accordance with window's size## 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
```python
from PyQt5.QtWidgets import QApplication, QWidget, QGridLayout
from pyqt_timer_label import TimerLabelif __name__ == "__main__":
import sysapp = 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
https://user-images.githubusercontent.com/55078043/154182901-bb7fd5fb-4eb1-46dd-bd5e-3cc9bacf95c7.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
* pyqt-transparent-timer