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

Резултати

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

Пребарај: #db

当前筛选 #db清除筛选
Pensive|

@PensivePost · Post #4940 · 18.02.2021 г., 18:48

BRUISED For if I told you that I love you Anywhere but in my poetry Coz I know my pen Would Slip Away And It would too Give you the power to walk away But no my dear So for now I will write For not manifesting my love And never for denying it I write implicit poetry Words inside me that I burry For I have mastered the art of concealing Through experience, the techniques of disguising Optical illusion overlaid on a lucid painting The sourness in my eye Veiled within a mimic smile Lips dyed in radiant color so they occur But a dull abstract as u look closer I trusted once revealing my secret But I ended up being its captive A mistake unlocked a new aspect And with silence I became adaptive A weightless body floating between time & space A glitch in a cosmos no gravity in my case Murky blood from a ruptured spleen A conversation in the dark with the monsters I’ve seen Haunted by the spoken but never meant A feign genesis from which I lack Kent Devils resembling a facsimile saint Words with their actions they never acquaint Took a lesson from the repeated voice To be stuck or to evolve is my choice Fading in the past or living in the present Cherishing the mistakes or frowning at the moment So here am writing With all I got embracing Inscribing my pain with the ink from my heart Palms bruised so I won’t fall apart To the scheme of world to the pit of lie I might be here but your deceits I won’t buy So to infect me with your diseases Please don’t try Over losing this attitude I would rather choose to die As an authentic bruised version of me Without a single manipulation there is to be So for now again I’ll let my fountain pen drain And spill its blood out On this half wrenched paper And scribble the words for no doubt And create an art ‘till the burning piece taper And pierce my heart And ache my head till its bursts And till my lung stifle And my hands go weak And my eyes drench And my ears bleed And my nose drop And my paper withers… I will then drown out the wrapped Into the ashbin Until it soaks all the scrap And then ask for something That’s long gone into the dark iniquity But lasts in my soul till the eternity. #review#DB#poetry

#DB#百家乐 🛍 🛍 🤝 🤝 🛍 🏦 🛍 🛍 😄 😄 😄 😄 😄 😄 😄 DB真人-百家乐是一款广受欢迎的博彩游戏,每种博彩游戏都有其独特的规则,百家乐也不例外。在开始玩百家乐之前,了解并掌握其规则至关重要。通过熟悉规则,不仅可以避免亏损并提高胜率,还能更专注地享受赌博带来的乐趣与刺激。 🎁充值 😀 😝 😝 😝 😀 😄喜提 😀 😀 😀 😀 😀 😀 😄 😄 😄 😄 😄 😄 📱 官方客服:@LBKF66 📱 合营招商:@LBZS01 📱 官方频道:@leboPD 📱 福利交流群:@LBYLSVIP 🛍乐博娱乐 知名品牌 安全可靠 值得信赖 🛍加入乐博,爆奖、提款、到账,一气呵成!

OKHK 👀

@iokhk · Post #9511 · 22.04.2026 г., 06:01

pgmicro 是一个基于 Turso(Rust 编写的 SQLite 重构版本)的实验性项目,它通过解析 PostgreSQL 语法并将其直接编译为 SQLite 字节码,实现了 PostgreSQL 的进程内嵌入式运行,适合 AI Agent 使用。 https://github.com/glommer/pgmicro #DB#Tool#AI#GitHub

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