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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #62 · 4 апр.

Когда разрабатываете свой GUI с помощью PyQt для какого-либо софта бывает необходимо позаимствовать цвета из текущего стиля интерфейса. Например, чтобы правильно раскрасить свои виджеты, подогнав их по цвету. Ведь бывает, что ваш GUI используется в разных софтах. Причём некоторые со светлой темой а другие с тёмной. По умолчанию стили наследуются, но если вы задаёте какую-либо раскраску для части виджета через свой styleSheet, то требуется ссылаться на цвета текущего стиля. Как это сделать? Как получить нужный цвет из палитры имеющегося стиля? Это достаточно просто, нужно использовать класс QPalette и его роли. Например, мне нужно достать цвет текста из одного виджета и применить его в другом как цвет фона (не важно зачем именно так, просто захотелось😊). Получаем палитру виджета и сразу достаём нужный цвет, указав его роль. from PySide2.QtGui import QPalette color = main_window.palette().color(QPalette.Text) теперь можем использовать этот цвет в стилях my_widget.setStyleSheet(f'background-color: {color.name()};') Готово, мы динамически переопределили дефолтный стиль используя текущий стиль окна! На самом деле есть запись покороче, в одну строку и без лишних переменных. Не очень-то по правилам CSS, но Qt это понимает. my_widget.setStyleSheet('background-color: palette(Text);') Этот способ не подходит если вам нужно как-то модифицировать цвет перед применением в своих стилях. В этом случае потребуется первый способ. Зато он прекрасно сработает в файле .qss, то есть не придётся в коде прописывать раскраску отдельных элементов через ссылки на палитру, всё красиво сохранится в отдельном файле .qss! QListView#my_widget::item:selected { background: palette(Midlight); } Про имеющиеся роли можно почитать здесь🌍 #qt#tricks

Hashtags

Резултати

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

Пребарај: #valentine

当前筛选 #valentine清除筛选
Everything Science

@everything_science · Post #3290 · 17.02.2025 г., 07:44

Single man in china once booked every other seat in a cinema theatre to split up couples on valentine's day. #Valentine 🔔@Everything_Science

Hashtags

🦅 [ perspective ix ]

@perspectiveix · Post #1110 · 14.02.2018 г., 20:00

​​❤️ Valentine's Day 2018 - The Cost Of Love Love it or loathe it, #Valentine's Day is an important date for the 🇺🇸 economy. According to the National Retail Federation (NRF), the average American will spend $143.56 on gifts this year, with total planned nationwide spending $19.6 billion. 55% of people are going to celebrate with jewelry ($4.7 billion), an evening out ($3.7 billion) and flowers ($2.0 billion) the top spending categories. 🚀@PerspectiveIX 🌀 ⁣http://prs.pctvix.co/TelegramIX

Hashtags

🚀 LAUNCH DAY #VALENTINE is going to enter the market. Chart’s will heating up. 📜 Contract: 0x3942B1e2F8B4B2d7921CE49A1fC0f805295F381C 💰 Tax: 3/3 🚀 Launching on 8/8 at 12:00 PM UTC ⏰ ➡️Ave on Broad ➡️Top trending booked ➡️#Valentine updated on #Dextool 🟢Chart: https://www.dexview.com/bsc/0x3942B1e2F8B4B2d7921CE49A1fC0f805295F381C ✉️Telegram https://t.me/bsc_Valentine 🐦Twitter https://x.com/bsc_Valentine

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40655 · 13.02.2026 г., 23:01

Saint Valentine’s Day, or simply Valentine’s Day, is celebrated on the 14th of February, but primarily in western societies. The day has been named after one or more martyrs of the early Christian era named Valentine or Valentinus who lived sometime in the 3rd century CE and were killed for defying oppressive laws directed either against Christians or young lovers in the Roman Empire. [read more here] @googlefactss#history#love#Valentine

APKPure_Official

@apkpurechannel · Post #2873 · 21.02.2026 г., 11:31

🔥💗Grow a Garden #Valentine Part 2 Event 👀#Leak 🚀💘Feb 22 - Mar 1 💕💕More Hearts!! Expect a huge variety of new Valentine's-themed cosmetics In the Valentine's part 2 update! With all these new features, you'll create heart-filled gardens, plus a brand-new quality-of-life update for the Heart Blossom Seed and much more in Grow a Garden! 💕💕💕 #gag#trade🌞#growagarden❤️#valentine🐝#garden 📅🎁Check out GAG Giant pet giveaways on TradeKitsune. Add @APKFreeDownloader_Bot to get any apk you want.

Kraze magazine Instagram Update Vogue Korea has released its February 2026 issue with Jimin as the main cover star. This edition, released in February, carries a Valentine’s theme and features a visual concept highlighting Jimin’s artistic character and personal identity. After Vogue published the February 2026 cover, Jimin ranked number one in global trending topics. Follow @kraze.official for daily and reliable updates on K-pop news, trends, events, and everything in between! 💌 [email protected] Source: Vogue Korea #Jimin#BTS#Vogue#VogueKorea#Valentine -@All_BTS_Updates