Есть у QLabel есть одна особенность. Её минимальный размер определяется текстом, который в неё записан. Это приводит к тому что длинный текст принудительно увеличивает ширину интерфейса.
В большинстве случаев это выглядит плохо.
Как с этим бороться?
🔸 Обрезать текст заранее, задав лимит по длине строки. В этом случае мы теряем часть визуальной информации. Не всегда угадаешь нужный размер. В разных OS шрифт используется разный.
🔸 Делать перенос строки. Тогда мы получим изменение размера в другую сторону, что тоже поломает интерфейс.
🔸 Переопределить paintEvent() и сделать кастомный рендеринг текста. Можно, но слишком сложно для такой задачи.
Проще всего обрезать текст под текущий размер виджета используя класс QFontMetrics.
Он имеет готовый метод elidedText(), который просто вызываем по событию resizeEvent.
Я также добавил установку ToolTip чтобы всегда можно было увидеть полный текст при наведении курсора.
🌎 Код здесь
#qt#source
📰Group Appearance Settings
Upgrading your group will unlock new features for the group:
- Color and Profile Logo
- Group Status Emoji
- Group Theme and Wallpaper
- Group Emoji Pack
#Boost | #Groups
👉The TG Times
📰Group Custom Emoji Pack
Group Admins can set a Custom Emoji Pack for the group.
All members can use emojis from this pack in the group, even without ⭐️ Premium subscription.
#Boost | #Groups
👉The TG Times
📰Boost to send messages in the group
Group admins can choose how many boosts a user must give to the group to bypass restrictions on sending messages.
#Boost | #Groups
👉The TG Times
📰Boosting Groups
Changes in the configuration of Telegram for macOS show that it will be possible to boost groups.
After upgrading groups, the ability to set the background for the group, choose the status emoji and choose the emoji pack for the group will be added.
It seems that just as in groups, the special sticker pack for that group can be set, it will also be possible to choose the emoji pack.
Thanks to @tgcrawl
#Boost | #Groups
👉The TG Times
📰Boosting Groups
Changes in the configuration of Telegram for macOS show that it will be possible to boost groups.
After upgrading grouos, the ability to set the background for the group, choose the status emoji and choose the emoji pack for the group will be added.
It seems that just as in groups, the special sticker pack for that group can be set, it will also be possible to choose the emoji pack.
Thanks to @tgcrawl
#Boost | #Groups
👉The TG Times
📰Boosting Groups
Changes in the configuration of Telegram for macOS show that it will be possible to boost groups.
After upgrading grouos, the ability to set the background for the group, choose the status emoji and choose the emoji pack for the group will be added.
It seems that just as in groups, the special sticker pack for that group can be set, it will also be possible to choose the emoji pack.
Thanks to @tgcrawl
#Boost | #Groups
👉The TG Times
@TheNexasMusic_bot
Qué puede hacer este bot?
Con este bot puedes reproducir música nn grupos de telegram a través del chat de voz!
Idioma: Inglés
(visto en @BotsGram_cu)
#groups, #music
@Gramaphone_voice_bot
Qué puede hacer este bot?
Con este bot puedes reproducir música nn grupos de telegram a través del chat de voz!
Idioma: Inglés
(visto en @BotsGram_cu)
#groups, #music
@MultiForwardBot
Qué puede hacer este bot?
Este bot reenvía mensajes y medios de tu canal a grupos ilimitados de telegram!
Idioma: Inglés, Italiano, Español
(visto en @BotsGram_cu)
#channel, #groups