Here you can see what the app looks like:
And here are a couple of screenshots to show how the app behaves based on the operation performed:
This project is a stopwatch application built with PyQt5, combining a real-time digital clock with a start/stop/reset timer. It features a custom 7-segment-style font, dynamic styling, and a clean, interactive interface.
- ✅ Stopwatch with Start / Stop / Reset functionality
- ✅ Real-time digital clock displayed at the top
- ✅ Updates every 10 milliseconds
- ✅ Custom font (
DS-DIGIT.TTF
) loaded safely with fallback - ✅ Clean UI with bold styling and hover effects
- ✅ Custom cursor for buttons
- ✅ Button states change dynamically (e.g., disable Start after press)
- ✅ Designed for modularity and clarity using multiple classes
PythonStopwatch/
├── main.py # Entry point – initializes and runs the app
├── stopwatch.py # Main widget – stopwatch UI and logic
├── digitalClock.py # Reused digital clock widget with real-time display
├── fonts/
│ └── ds_digital/
│ └── DS-DIGIT.TTF # Custom digital-style font
The app uses Qt Style Sheets (QSS) within Python to style:
- Labels and buttons with rounded borders
- Button hover states
- Font sizes and background colors
Buttons are enhanced with a pointing hand cursor to signal interactivity.
- The stopwatch uses
QTime
andQTimer
to track elapsed time in 10ms intervals. - The digital clock updates every second using its own
QTimer
. - Time is formatted consistently using
f"{val:02}"
specifiers to ensure fixed-width layout. - The custom font is loaded using
QFontDatabase.addApplicationFont(...)
with safe fallbacks and exception handling. - Font path detection adapts for PyInstaller or
.app
bundle usage.
pip install PyQt5
python main.py
The stopwatch uses a custom font stored at:
fonts/ds_digital/DS-DIGIT.TTF
It is loaded programmatically and safely handled in case the file is missing or fails to register.
Built by @fgatto13
This project reflects applied concepts of custom font handling,
time management, event-driven programming, and clean UI design in PyQt5.
This project is based on a PyQt5 digital stopwatch tutorial originally created by BroCode.
The original tutorial served as a foundation for building a simple stopwatch GUI.
This version adds:
- event handling of the various buttons (enabled/disabled dynamically)
- dynamic changes based on events for the text
- a custom font
- reuse of another custom widget (digital clock)