TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #110 · 3 јул.

Есть у QLabel есть одна особенность. Её минимальный размер определяется текстом, который в неё записан. Это приводит к тому что длинный текст принудительно увеличивает ширину интерфейса. В большинстве случаев это выглядит плохо. Как с этим бороться? 🔸 Обрезать текст заранее, задав лимит по длине строки. В этом случае мы теряем часть визуальной информации. Не всегда угадаешь нужный размер. В разных OS шрифт используется разный. 🔸 Делать перенос строки. Тогда мы получим изменение размера в другую сторону, что тоже поломает интерфейс. 🔸 Переопределить paintEvent() и сделать кастомный рендеринг текста. Можно, но слишком сложно для такой задачи. Проще всего обрезать текст под текущий размер виджета используя класс QFontMetrics. Он имеет готовый метод elidedText(), который просто вызываем по событию resizeEvent. Я также добавил установку ToolTip чтобы всегда можно было увидеть полный текст при наведении курсора. 🌎 Код здесь #qt#source

Hashtags

Резултати

Пронајдени 3 слични објави

Пребарај: #hcws

当前筛选 #hcws清除筛选

The overall goal of Infection Prevention & Control is to maintain an environment of care that minimises risks of infection for patients, staff & visitors. These #IPC guidelines must be practised by all #HCWs in public and private primary, secondary & tertiary healthcare facilities. Read more in the Nigerian Manual of Infection Prevention and Control: https://ncdc.gov.ng/themes/common/docs/protocols/296_1649340294.pdf

Hashtags

The overall goal of Infection Prevention & Control is to maintain an environment of care that minimises risks of infection for patients, staff & visitors. These #IPC guidelines must be practised by all #HCWs in public and private primary, secondary & tertiary healthcare facilities. Read more in the Nigerian Manual of Infection Prevention and Control: https://ncdc.gov.ng/themes/common/docs/protocols/296_1649340294.pdf

Hashtags

The overall goal of Infection Prevention & Control is to maintain an environment of care that minimises risks of infection for patients, staff & visitors This #IPC guideline for viral haemorrhagic fevers must be practised by all #HCWs in public & private primary, secondary & tertiary healthcare facilities. 🔗 https://ncdc.gov.ng/themes/common/docs/protocols/341_1707300274.pdf #TakeResponsibility to #StaySafe