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

Резултати

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

Пребарај: #egm

当前筛选 #egm清除筛选
NIDO Russia (НИДО)

@nido_russia · Post #1847 · 26.10.2024 г., 12:30

NIDO Europe invites all members of NIDO Russia to an extraordinary general meeting. It will be held online. Benefits ✅ Take part in shaping Diaspora affairs on a continental level. ✅ Attendance is free ✅ Network with business partners around the European continent ✅ Make new friends/acquaintances ✅ Pitch your ideas ✅ The most active unofficial participant from NIDO Russia positively representing our interests will receive a token of appreciation for voluntary contribution to the diasporan affairs on a continental level. Take advantage of this golden opportunity. Registered members can simply send me a short message saying "I'm interested", and we'll do the rest and hook you up. Dr. Godwin Ibe, Chairman, NIDO Russia +79262385618 *This is a requisitioned EGM by members in accordance with the act of Parliament in the United Kingdom. #nidoe#nidoEurope#nidorussia#nido#NigeriansInDiaspora#egm

NIDO Russia (НИДО)

@nido_russia · Post #1843 · 23.10.2024 г., 17:59

NIDO Europe invites all members of NIDO Russia to an extraordinary general meeting. It will be held online. Benefits ✅ Take part in shaping Diaspora affairs on a continental level. ✅ Attendance is free ✅ Network with business partners around the European continent ✅ Make new friends/acquaintances ✅ Pitch your ideas ✅ The most active unofficial participant from NIDO Russia positively representing our interests will receive a token of appreciation for voluntary contribution to the diasporan affairs on a continental level. Take advantage of this golden opportunity. Registered members can simply send me a short message saying "I'm interested", and we'll do the rest and hook you up. Dr. Godwin Ibe, Chairman, NIDO Russia +79262385618 *This is a requisitioned EGM by members in accordance with the act of Parliament in the United Kingdom. #nidoe#nidoEurope#nidorussia#nido#NigeriansInDiaspora#egm

NIDO Russia (НИДО)

@nido_russia · Post #1832 · 19.10.2024 г., 05:01

NIDO Europe invites all members of NIDO Russia to an extraordinary general meeting. It will be held online. Benefits ✅ Take part in shaping Diaspora affairs on a continental level. ✅ Attendance is free ✅ Network with business partners around the European continent ✅ Make new friends/acquaintances ✅ Pitch your ideas ✅ The most active unofficial participant from NIDO Russia positively representing our interests will receive a token of appreciation for voluntary contribution to the diasporan affairs on a continental level. Take advantage of this golden opportunity. Registered members can simply send me a short message saying "I'm interested", and we'll do the rest and hook you up. Dr. Godwin Ibe, Chairman, NIDO Russia +79262385618 *This is a requisitioned EGM by members in accordance with the act of Parliament in the United Kingdom. #nidoe#nidoEurope#nidorussia#nido#NigeriansInDiaspora#egm

Crypto Profits Hub

@Futurentry · Post #4006 · 04.11.2024 г., 23:28

😳➕7️⃣5️⃣2️⃣2️⃣🔣total profit from our VIP signals for the last week 🔝(28.10 - 04.11) 🔝 😎 As usual, my weekly report! You can clearly see how our results have changed compared to last week.😊 The market is very positive and this is just the beginning, the bull run will show us all what big money is and I do not advise you to miss such a rare opportunity. ✈️ Let's fly guys! New week - New records!✈️ ✅ +825% #GMI/SOL ✅ +476% #DOUG/SOL ✅ +436% #KAMALA47/WETH ✅ +411% #AVATAROS/SOL ✅ +370% #MORT/SOL ✅ +314% #JUJU/SOL ✅ +304% #WHATITIS/SOL ✅ +304% #🗳/SOL ✅ +264% #SPEANUT/WETH ✅ +263% #SUKI/SOL ✅ +249% #ÆHEDGE/SOL ✅ +242% #DEVCAT/SOL ✅ +228% #DOGI/WETH ✅ +219% #HUMAN/SOL ✅ +215% #TRINA/SOL ✅ +209% #SENDISM/SOL ✅ +206% #MAMA/SOL ✅ +205% #REDO/SOL ✅ +184% #EGM/SOL ✅ +178% #APPLE AI/SOL ✅ +147% #SOLANA/SOL ✅ +143% #EAR/SOL ✅ +138% #BUTTERFLY/SOL ✅ +133% #GHOSTEUS/SOL ✅ +117% #DEGENAI/SOL ✅ +113% #PDJT/WETH ✅ +108% #3DMAN/SOL ✅ +103% #MOMA/SOL ✅ +83% #B4TS4K/SOL ✅ +73% #BTCWIZARD/WETH ✅ +71% #ΧΑΧΑ/SOL ✅ +70% #PRUMP/SOL ✅ +70% #CHOPIN/SOL ✅ +70% #DEFORG/SOL ✅ +67% #MERLIN/WETH ✅ +57% #XAU/WETH ✅ +52% #EZSIS/SOL ❎ -50% #TSUYU/WETH ❎ -30% #PIPI/WETH ❎ -30% #SIGH/SOL ❎ -30% #PENGUIN/WETH ❎ -30% #SNOO/WETH ❎ -15% #GRUK/SOL ❎ -10% #NEKO/SOL Join our VIP channel and get these results every day👇@Riley_Fe