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

Резултати

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

Пребарај: #climatechange

当前筛选 #climatechange清除筛选
Feruzbek Sayfullayev

@FeruzbekSayfullayev · Post #3550 · 26.03.2026 г., 02:46

🚨 O‘zbekiston aholisi favqulodda vaziyatlar haqida masjidlar orqali ogohlantiriladi 🤝 Biz Favqulodda vaziyatlar vazirligi bilan hamkorlikda ofatlar yuzaga kelganda imkon qadar ko‘proq aholiga tezkor axborot yetkazishni ta’minlashga qaratilgan innovatsion yechimni amalga oshirmoqdamiz. 📢 Mazkur tashabbus doirasida 7 ta hududdagi 272 ta masjid maxsus uskunalar bilan jihozlandi. Ushbu uskunalar orqali FVVning tezkor xabarlari masjidlarning tashqi ovoz kuchaytirgichlari yordamida uzatiladi va keng jamoatchilikka tez ravishda yetkaziladi. 👥 Loyiha hisob-kitoblariga ko‘ra, masjidlar orqali ogohlantirish tizimi taxminan 6,5 million nafar aholini qamrab olishi mumkin. 🌍 Iqlim xavflari ortib borayotgan bugungi sharoitda erta ogohlantirish tizimlarini mustahkamlash inson hayotini saqlab qolishda muhim ahamiyatga ega. Batafsil: https://go.undp.org/SMy - - - - 🚨 Жители теперь могут получать экстренные оповещения через громкоговорители мечетей. 🤝 Мы совместно с МЧС внедрили инновационное решение, направленное на оперативное информирование как можно большего числа людей во время чрезвычайных ситуаций. 📢 В рамках инициативы 272 мечети в 7 регионах оснащены специальными устройствами, позволяющими передавать экстренные сообщения МЧС через внешние громкоговорители мечетей и оперативно доводить информацию до широкой аудитории. 👥 По оценкам проекта, оповещение через мечети позволяет охватить около 6,5 млн человек. 🌍 В условиях роста климатических рисков укрепление систем раннего оповещения играет ключевую роль в спасении жизней. Подробнее: https://go.undp.org/SQZ #MHEWS#ClimateChange

Reuters: World

@reutersworldchannel · Post #149553 · 19.10.2021 г., 09:47

Designer Vivienne Westwood shares her 'Letter to Earth' British fashion designer Vivienne Westwood and Nigerian author Ben Okri read out their 'Letters to the Earth' as part of a campaign urging action against climate change in the run-up to the U.N. #COP26 summit. #News#Reuters#ClimateChange Subscribe: http://smarturl.it/reuterssubscribe Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled. Get the latest news on: http://reuters.com/ Follow Reuters on Facebook: https://www.facebook.com/Reuters Follow Reuters on Twitter: https://twitter.com/Reuters Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en ➖@reutersworldchannel➖

Reuters: World

@reutersworldchannel · Post #149550 · 19.10.2021 г., 02:04

Explained: Key things to watch for at COP26 As public pressure grows for action to limit climate change, world leaders from nearly 200 countries will convene in Glasgow, Scotland, at the end of October for the COP26 conference. Here are the key climate issues that need resolution. #COP26#News#Reuters#ClimateChange Subscribe: http://smarturl.it/reuterssubscribe Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled. Get the latest news on: http://reuters.com/ Follow Reuters on Facebook: https://www.facebook.com/Reuters Follow Reuters on Twitter: https://twitter.com/Reuters Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en ➖@reutersworldchannel➖

Venezuelanalysis

@venanalysis · Post #2062 · 12.08.2025 г., 20:51

📝 INTERVIEW | Esquisa Omaña: ‘Agroecology Is the Alternative to the Climate and Civilization Collapse’ In the latest VA interview, Venezuelan biologist and ecologist Esquisa Omaña, a researcher at the Venezuelan Institute for Scientific Research (IVIC) and doctoral candidate in Agrarian Social Studies at the University of Córdoba (Argentina), discusses agroecology as a grassroots alternative to agribusiness. She is also active in the GMO-Free Venezuela Campaign and the Pueblo a Pueblo Plan. 'Agroecology or nothing,' states Omaña, stressing that only community-based farming rooted in Indigenous and Afro-descendant traditions can confront the climate and civilization collapse. She points to rotational conuco agriculture and initiatives like Pueblo a Pueblo, which supplies 100 tons of food monthly to schools, as proof that local models can feed people while challenging corporate control of food systems. 🔗 Read the full interview here: https://shorturl.at/zWvmQ #Agroecology#ClimateChange#PuebloaPueblo

123•••56
ПретходнаСтраница 1 од 6Следна