@wallpapersarena · Post #6674 · 14.12.2024 г., 06:30
#Superheroes @WallpapersArena
Hashtags
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
Пребарај: #superheroes
@wallpapersarena · Post #6674 · 14.12.2024 г., 06:30
#Superheroes @WallpapersArena
Hashtags
@wallparpes_hd · Post #842 · 25.04.2020 г., 13:14
Red Hood 2020 #superheroes 📱 Los mejores Wallpapers ⭐📱 @wallparpes_hd
Hashtags
@wallparpes_hd · Post #759 · 21.04.2020 г., 17:54
Hellboy Fanart #superheroes 📱 Los mejores Wallpapers ⭐📱 @wallparpes_hd
Hashtags
@wallparpes_hd · Post #662 · 12.04.2020 г., 17:15
Venom X Punisher #superheroes 📱 Los mejores Wallpapers ⭐📱 @wallparpes_hd
Hashtags
@wallparpes_hd · Post #120 · 19.03.2020 г., 17:20
Doctor Strange In The Multiverse Of Madness #superheroes 📱 Wallpapers Full HD 📱⭐ https://t.me/joinchat/AAAAAE65rdIFyMNq1qiq7A
Hashtags
@wallparpes_hd · Post #108 · 18.03.2020 г., 22:31
Deadpool Cool #superheroes 📱 Wallpapers Full HD ⭐📱 https://t.me/joinchat/AAAAAE65rdIFyMNq1qiq7A
Hashtags
@wallparpes_hd · Post #93 · 18.03.2020 г., 22:27
Doctor Strange In The Multiverse Of Madness #superheroes
Hashtags
@wallparpes_hd · Post #89 · 17.03.2020 г., 23:13
The Punisher Man #superheroes
Hashtags
@wallparpes_hd · Post #88 · 17.03.2020 г., 23:12
Deathstroke #superheroes
Hashtags
@wallparpes_hd · Post #75 · 17.03.2020 г., 14:35
Justice League New 2020 #superheroes
Hashtags
@images · Post #1543 · 30.05.2024 г., 13:43
🍿 The Last Adventure of 'The Umbrella Academy'! 📆Premiere: August 8, 2024 🎭Genre: #Superheroes · #Drama The Hargreeves return for one final mission in the fourth and last season of 'The Umbrella Academy'. This time, without their powers, they must adapt to normal life, though chaos still ensues. 🌀 Elliot Page, Tom Hopper, and the rest of the original cast are back, along with new additions Nick Offerman and Megan Mullally. The curious part: the Thibedeaus, college professors with extreme déjà vu! 🤯 Reginald Hargreeves is back, leading a dark empire, while a mysterious organization believes reality is a lie. Don’t miss the trailer set to 'The Final Countdown'. 🎬💥 > 𝘴𝘦𝘳𝘪𝘦𝘴 · 🚀𝘣𝘰𝘰𝘴𝘵
Hashtags
@images · Post #1746 · 20.12.2024 г., 08:54
🍿 Superman: Legacy, the Rebirth of Hope ☀️ 📆Release: July 11, 2025 🎭Genre: #Action · #Fantasy · #Superheroes I just watched the trailer, and I’m filled with excitement. James Gunn’s Superman (Guardians of the Galaxy) focuses on kindness. David Corenswet (Hollywood) dons a colorful suit, flying and shielding a little girl. Rachel Brosnahan (The Marvelous Mrs. Maisel) brings a spark to Lois Lane, while Nicholas Hoult (Mad Max: Fury Road) promises a compelling Lex Luthor. Guy Gardner, with his bowl cut, couldn’t be more perfect. And Krypto, that dog, melts my heart. This movie looks like it’ll radiate optimism, reminding us that the world needs heroes who inspire. I can’t wait to see it. 🎉
Hashtags