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

TGINSIGHT SIMILAR POSTS

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

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

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

Hashtags

Резултати

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

Пребарај: #independenceday

当前筛选 #independenceday清除筛选
MPA GLOBAL

@mpa_creative · Post #196 · 01.09.2022 г., 10:49

Ассалому алайкум Ахли ватандошим! Энг улуғ Энг азиз аём Мустақиллигимизнинг 31 йиллиги байрами билан барчангизни самимий муборакбод этаман сиҳат-саломатлик, хонадонларингизга файзу барака ва фаровонлик тилайман. Мустақил Ватанимизнинг тинчлиги, гуллаб-яшнаши ҳамда равнақи йўлида олиб бораётган фаолиятингизда омад ва зафарлар ёр бўлсин! Мустақиллик истиқлолимиз абадий бўлсин! Хурмат билан Нафосат! #independenceday#uzbekistan🇺🇿 @nafosat_uz

स्वतंत्रता दिवस के अवसर पर प्रधानमंत्री नरेंद्र मोदी ने लाल किले की प्राचीर से विकसित भारत के लक्ष्य को प्राप्त करने हेतु देशवासियों के साथ कई लक्ष्य निर्धारित किए। आइए इस 🧵 द्वारा जानें... #IndependenceDay #PMModi

Russian MFA 🇷🇺

@MFARUSSIA · Post #28218 · 04.02.2026 г., 08:03

🇱🇰On February 4, Sri Lanka celebrates Independence Day - a defining moment in the country’s history. On this day back in 1948, Ceylon (officially renamed Sri Lanka in 1972) gained independence from the British rule, ending nearly 450 years of European colonial domination by the Portuguese, Dutch, and British. Independence was achieved through constitutional means, making Sri Lanka one of the first countries in South Asia to peacefully secure sovereignty through negotiation. 📝 Colonial policies, including the British “divide and rule” approach and the plantation-based economic model, significantly reshaped the island’s social structure and economy, with long-term consequences for interethnic relations and development. The independence movement was driven by political leaders, youth organizations, trade unions, and the Buddhist revival movement, which played a key role in preserving national identity, language, and cultural traditions. Sri Lanka, being one of the founding members of Non-Aligned Movement, has been steadily following a non-aligned foreign policy and remains an active participant in international and regional organizations. 🤝Diplomatic relations between our country and Sri Lanka were established on February 19, 1957. Over the decades, bilateral cooperation has expanded in areas such as education, culture, humanitarian exchanges, and people-to-people contacts, developing in a spirit of friendship, trust, and mutual respect. 💬Levan Dzhagaryan, Ambassador of Russia to Sri Lanka: I warmly congratulate the people of Sri Lanka on their national holiday and wish the country peace, stability, prosperity, and continued development. #SriLanka#IndependenceDay

ПретходнаСтраница 1 од 3Следна