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

Резултати

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

Пребарај: #everyone

当前筛选 #everyone清除筛选
Buidlpad

@native_fi · Post #46 · 07.06.2025 г., 04:03

#everyone The submission window for our $SAHARA Priority Allocation is now closed. Thank you to everyone who submitted thoughtful and original content supporting Sahara AI 💙🔆 Every submission will undergo a manual review for quality. Selected contributors will receive an email by June 10 at 00:00 AM UTC with: • Their unique invitation code • Priority Allocation amount • Steps to complete KYC and subscribe If you participated, please keep an eye on your inbox (and spam folder) for updates from Buidlpad. We’re proud to recognize and reward the community members creating value around Sahara AI. Stay tuned for the upcoming KYC Stage! @gBuidl💙

Hashtags

Pensive|

@PensivePost · Post #4790 · 21.01.2021 г., 21:56

*Who Am I* Ah! This drizzling rain Those lovely skies I love it all I don't know why These twinkling stars That lovely moon I wanna see them Even in the noon I wanna run I wanna fly Do everything possible Before I die That's what a part of me Always says The part I wish could Forever stay But in this world That's not the case Like every coin I have another face The one which is scared The one which is shy Wanting to be heard Almost ready to cry That me doesn't have A place to go Neither when I burn Nor when I glow I spend nights wondering Which of them is right I often put them in a battlefield But they refuse to fight So now I'm really confused I don't know why All I wanna know is who am I .. #review#everyone#poem

Pensive|

@PensivePost · Post #4761 · 18.01.2021 г., 08:33

*Perhaps my soul is dark* I am drawn into your world That you so darkly carved With your emptiness Perhaps my soul is dark Perhaps I like black holes Perhaps I hope to emerge On the other side as bright As a brilliant.radiant star That lights up a million worlds Im sorry Jasmine I am drawn to your dark nudity The poverty of your humanity Perhaps my soul is dark Perhaps I like the thorns better Than the roses and the fragrance Of blood better than jasmine Perhaps I want to break through The darkest night pouring into A zig zillion shards of light silently making a new dawn #review, #RC, #Everyone, #poetry

Pensive|

@PensivePost · Post #5350 · 07.08.2021 г., 23:32

The beau, ignorance. I knew. That made me a shitty person If there was anything that made it unbearable and more hard to overcome than anything, it’s the fact that I knew it was going to happen. It’s a pity we don’t get to un-know stuff. Like just trash it. It felt(no, was )wrong. Like hoarding the girls lavatory or cyber bullying overweight people because it felt right Or self-hurting so you can feel anything other than this unimaginable sorrow that was slowly drowning you. If there was anything that was worse than knowledge, it’ll be passivity, more like apathy. The fact that you didn’t act. That I didn’t act This didn’t feel wrong. It didn’t feel like anything I have ever felt. Words can’t quantify how it feels. Probably, nothing will. I hope nothing does. Excerpt from my book, For the Lies that Matter @whosayegat #review #everyone #excerpts

VIP_影视分享

@wangzhuanzhan · Post #32762 · 10.09.2024 г., 07:01

R-r人r人r都d说s我w爱a你n- 人人都说我爱你 Everyone Says I Love You (1996) 直达链接:https://pan.quark.cn/s/6a7fc5716f09 #人人都说我爱你#Everyone Says I Love You #大家都说我爱你#为你唱情歌 链接:https://link3.cc/sf_com #电影#喜剧#美国#90年代