CuteElide
CuteElide is a tiny, robust text‑elision toolkit for PySide6 that never gets stuck after resize. It elides at paint time, so it always reflects the current width.
If you’ve ever had QLabel text that elides once and then refuses to reflow when the window shrinks, CuteElide is the end of that pain.
Highlights
- Paint‑Time Elision: Always correct on expand and shrink — no timers, no resize hacks.
- Widget‑Agnostic: Works with any widget (custom or themed). Use the renderer in any
paintEvent. - Left, Right, or Middle: Pick the elide mode that fits your UX.
- Tiny Surface Area: One facade import with clear, expressive methods.
Installation
pip install CuteElide
Quick Start
1) Use the utility in any widget
from PySide6.QtCore import Qt
from PySide6.QtGui import QPainter
from cuteelide import cuteelide
# Inside paintEvent:
cuteelide.paint(
painter,
rect=self.contentsRect(),
text="Some stories are longer than the space they’re given",
font=self.font(),
palette=self.palette(),
mode="middle",
)
2) Drop‑in label
from PySide6.QtCore import Qt
from cuteelide import cuteelide
label = cuteelide.label(
text="A very long string that should always elide correctly",
mode="right",
)
What is eliding?
Eliding is the art of saying “this sentence is too long” without cutting the sentence in half. When there isn’t enough space, we replace the overflowing part with a gentle “…” so the UI stays clean, and the reader still knows there’s more beneath the surface.
Why Paint‑Time Elision
Resize‑driven elision is fragile because Qt layouts change geometry late in the event cycle. By eliding at draw time, CuteElide uses the exact width that will be painted — every frame.
Demo
A small demo app is included to showcase all elision modes and a custom paint example.
python examples/demo.py
API Overview
cuteelide.text(text, font, width, mode)cuteelide.paint(painter, rect=..., text=..., mode=..., align=..., padding=...)cuteelide.label(text=..., mode=..., align=..., padding=...)
License
CuteElide is Free and Open Source Software (FOSS), distributed under the GNU General Public License v3.0 or later.
From the Developer 💖
I hope CuteElide saves you the time I’ve lost to resize‑glitchy labels! If you’d like to support my work or see what else I’m up to, here are a few links:
- Buy Me a Coffee: You can help fuel more projects like this at my Ko-fi page.
- My Website & Socials: See my art, poetry, and other dev updates at artificialsweetener.ai.
- If you like this project, it would mean a lot to me if you gave me a star here on Github!! ⭐
Metadata
Release files for CuteElide 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cuteelide-1.0.0.tar.gz | 20.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cuteelide-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.2 kB
Release files / cuteelide-1.0.0.tar.gz
| Download URL | cuteelide-1.0.0.tar.gz |
|---|---|
| Size | 20.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c44f63cd62fbf9f2cbf759b30e4201c076eed59ef1e5348ae92387d15b265ca0
|
|
BLAKE2b-256 checksum How to use checksums |
2b40ff278c87a031b8b225855b9ee8e028158f2b5b91286ffd09595dc69b3bfb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / cuteelide-1.0.0-py3-none-any.whl
| Download URL | cuteelide-1.0.0-py3-none-any.whl |
|---|---|
| Size | 17.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
31bb3c47fbe2b466d8f5976a83a9d92620451fb25cd81377c96b70c6012ffc57
|
|
BLAKE2b-256 checksum How to use checksums |
216328a56a18f619f9c9adbdaf881eccb232e1e779b2de3388cf082557f204ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|