PyQt QLabel adapted to timer feature
Project description
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 likedoubleClicked
,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
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyqt-timer-label-0.0.1.tar.gz
.
File metadata
- Download URL: pyqt-timer-label-0.0.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/0.0.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83778d25dc25f2edc022f798362db590364256ff3b2bd3ab77ed1e0fa8d8c337 |
|
MD5 | 8bc9f858afe1d5affd69b83e3adfc72f |
|
BLAKE2b-256 | fa633b3937f5dec99c0053d712451180cb389a357263c68bd79ab364dc392a82 |
File details
Details for the file pyqt_timer_label-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: pyqt_timer_label-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/0.0.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28f8da9c09a0a8d2adb9f71bfde679ed576df3aaa4612bf8587209fcb56d5bdf |
|
MD5 | 97b16344f7e488e0387f3722eaa61d3e |
|
BLAKE2b-256 | 66e8777aefa4322d51dd120a110e2fcd4d166340c38ec5442a9c9094679356dd |