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

Резултати

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

Пребарај: #andijan

当前筛选 #andijan清除筛选
EKOLOG.UZ| ENG

@ekologuzenglish · Post #11876 · 11.03.2026 г., 04:02

#Andijan Over the past 10 days, shepherds have brought a herd of horses and sheep onto the lands of the “Green View” farm, destroying years of tree seedlings grown on the hills of Asaka District, Andijan region. In addition, the drip irrigation systems were damaged and rendered unusable. The farmers repeatedly warned the shepherds, recorded the situation on video, and appealed to the internal affairs authorities, but no action was taken. As a result, the shepherds continue to graze their animals on the farm’s land. The farmer suffered from back pain for more than a week and, after recording the damage on video and contacting the 102 hotline, still received no response or action from the authorities. The farmers ask: Why is their labor not protected? Why is there no accountability for violations of the law? Who protects the work done to turn desert lands into green areas? They request that the Ministry of Internal Affairs of the Republic of Uzbekistan pay attention to this situation and ensure justice is served within the framework of the law. ☘️Read the latest environmental news on the @ekologuz page. Follow us and send your suggestions and wishes via @eklguz_bot Instagram | Facebook | Twitter | Sayt | Youtube.

Hashtags

EKOLOG.UZ| ENG

@ekologuzenglish · Post #11770 · 02.03.2026 г., 07:59

#Andijan The treatment of birds by staff at the Andijan Zoo has raised serious concerns. This raises an important question: do we need private zoos? The greatest risk is cruelty towards animals. In many cases, the pursuit of profit is placed above the peace and well-being of animals. ☘️Read the latest environmental news on the @ekologuz page. Follow us and send your suggestions and wishes via @eklguz_bot Instagram | Facebook | Twitter | Sayt | Youtube.

Hashtags

Andijan Development Center

@adceducate · Post #9656 · 04.08.2025 г., 15:44

❓ Ingliz tilida e’tiroz bildirishingiz kerak… Lekin qo‘pol chiqib qolishni xohlamaysiz? 👀 Bugungi mini-viktorinada aynan shuni mashq qilamiz! Qaysi variant madaniyatli va to‘g‘ri?👇 🅰️ I’m not agreeing with that 🅱️ I beg to differ 🆑 I don’t think so, and you’re wrong 💬 Javobingizni kommentariyada yozing! To‘g‘ri javob va tushuntirish — videoda! 🎥 📌 Boshqa foydali iboralarni o‘rganmoqchimisiz? Obuna bo‘ling va bizni kuzatib boring! 📞 Aloqa uchun: 📱 +998742261078 / +998994314134 📨 Telegram: @admofadc #adcenglish#ingliztili#englishquiz#andijan

Andijan Development Center

@adceducate · Post #8057 · 08.12.2023 г., 04:26

🇺🇿Поздравляем всех вас с одним из главных праздников нашей страны – «8 декабря — День Конституции Республики Узбекистан». Желаем всем Вам и Вашим близким крепкого здоровья, семейного благополучия, успехов в Вашей профессиональной деятельности и удачи во всех благих начинаниях! #adceducate#adc#andijan#tashkent#taraqqiyot#instagood#instagram#asaka#uzbekistan#adcteam#andijandevelopmentcenter#privateschool#спраздником#holiday Telegram Instagram FacebookTikTokYoutube