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

TGINSIGHT SIMILAR POSTS

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

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

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

Hashtags

Резултати

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

Пребарај: #competititon

当前筛选 #competititon清除筛选

The proposal for the Philharmonic Hall in Prague by Henning Larsen. The new Prague Vltava Philharmonic will be the perfect ‘instrument’ - an expression of this place - realized in a new artistic language. Its cresting spires play in harmony with the towers, turrets, steeples and spires that grace the tapestry of the city’s roofscape. Architecture: Henning Larsen #danisharchitecture#arch_shovel#NewsArchitecture#competititon#architecture

Philharmonic Hall in Prague by Ludgaard & Tranberg. Ludgaard & Tranberg’s design proposal created in collaboration with Cobe Architects for the Vlatava Philharmonic Hall in Prague. Music, art, architecture, the city and the audience converge in a concert hall that extends its vibrations far beyond the site by the river Vltava. Architecture: Ludgaard & Tranberg & Cobe Architects Acoustics: Gade & Mortensen Akustik Consultation: Tyrens #danisharchitecture#arch_shovel#NewsArchitecture#competititon#architecture