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

Резултати

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

Пребарај: #widgets

当前筛选 #widgets清除筛选
HiShoot2i Templates

@hishoot2imaterial · Post #2599 · 12.05.2025 г., 15:29

⚡️ Giveaway Time! 🎁 🚀 We're giving away 25 promo codes for Photo Widget Pro25 lucky winners will be chosen in 24 hours. Eligibility: - You must be a member of: ~ @AppsLab_Co ~ @popMODS ~ @popmodschat - How to redeem codes? - Click here Notes and warns: - Please don't forget to rate and comment the app(s) after you redeemed. - You have 24 hours to get your code from the bot, later then, you won't get your code even if you won. - Anyone who joins only for the giveaway and leaves the channel immediately after the giveaway is over will be banned indefinitely. It does not matter when you leave. 🏷 Tags: #Android#Widgets#Giveaway

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #602 · 26.04.2025 г., 18:31

Widgets Pro- Nothing inspired Widgets ✍️ Details: - Version: 1.1.8 ⬇️ Download : Here 📔 Source : Here 📸 Screenshots : Here 👨‍💻 Support Group : Here ✍️ Note: - Minimum sdk is 14. - If you are unable to give necessary permissions, go app info > 3 dot menu & allow restricted access from there. 😎 Developer : @tpk53 | @RedSkulxHYDRA 💬 Community: @Nothing_Archive 🔖 Tags : #CommunityProject#App#Widgets#Nothing

Venture Village Wall 🦄

@venturevillagewall · Post #4339 · 08.03.2025 г., 13:00

Top 5 Insights from Trendoscope Lab 1️⃣ a16z's new report reveals top B2C AI apps by traffic differ from revenue leaders like photo and video editors. Read more 2️⃣ Google launches AI Mode with Gemini, initially for Google One subscribers, enhancing AI SEO relevance. Details here 3️⃣ Short drama apps surge with 221% annual growth in downloads, affecting traditional streamers like Netflix and Disney+ that declined by 35%. Insight found here 4️⃣ Google and Meta enable developers to access cameras on XR devices, easing previous privacy restrictions. More info and here 5️⃣ Google enhances Android widget visibility with new filters and dedicated pages. Learn more #AI#Google#Tech#Streaming#XR#Investments#B2C#Apps#VideoEditing#Photos#Dramas#SEO#Privacy#Android#Widgets#Investing#VC#a16z#Trends#Innovation

GitHub Trends

@githubtrending · Post #15204 · 08.10.2025 г., 11:30

#java#cloud#coap#dashboard#iot#iot_analytics#iot_platform#iot_solutions#java#kafka#lwm2m#microservices#middleware#mqtt#netty#platform#snmp#thingsboard#visualization#websockets#widgets ThingsBoard is an open-source IoT platform that helps manage and analyze data from connected devices. It allows users to collect data, create real-time dashboards, and automate tasks using a powerful rule engine. This platform supports various protocols like MQTT and HTTP, making it easy to connect devices. Users can also define relationships between devices and assets, and trigger alarms based on specific conditions. The benefit is that it simplifies IoT project development, making it scalable and efficient for applications like smart farming, smart offices, and more. https://github.com/thingsboard/thingsboard