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

Резултати

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

Пребарај: #quasark

当前筛选 #quasark清除筛选
Quasark.io - Announcement

@quasark_channel · Post #8 · 05.07.2023 г., 15:08

💥CLOSED BETA TESTERS SELECTED! Attention all #QuasarK enthusiasts! We are thrilled to announce that we have selected our closed beta testers for the upcoming QuasarK app on iOS and Android 🎉 To our selected beta testers, congratulations! 🥳 You are the chosen ones who will get an exclusive sneak peek 👀 into the app's features, functionalities, as well as a bunch of exciting perks. Your valuable feedback and insights will help us refine and enhance🚀 the QuasarK experience for everyone. ✅ We have granted all beta testers a special role in our QuasarK Discord server. This role comes with access to a private channel dedicated to the closed beta testing. There, we will keep you updated on all the important information📩 regarding the app's access, updates, and any announcements related to the beta testing phase. Make sure to check your Discord notifications for the role assignment and say hello in the private chats📲💬 We are incredibly excited 🙈 to have you on board, and we can't wait to embark on this beta testing journey together. Your input and feedback will play a vital role in shaping the final release of QuasarK 💫, and we greatly appreciate your dedication and involvement in this process. Thank you once again 😍 for being part of the QuasarK community and for your continued support. Stay tuned🔔 for more updates, surprises, and the official launch of QuasarK coming soon!

Hashtags

Quasark.io - Announcement

@quasark_channel · Post #7 · 04.07.2023 г., 07:49

📢CLOSED BETA WHITELIST CLOSED Attention, QuasarK Community: the application period for our closed beta is now officially closed. We want to express our heartfelt thanks ❤️ to everyone who applied and showed their interest in being a part of this exclusive testing phase. Your support and enthusiasm mean the world to us! 👏 🚀 But hold on tight, because the journey is just getting started! In a matter of days we’ll be reaching out to our whitelisted beta testers🏆. If you made it to the whitelist, keep an eye on your notifications and direct messages 📩 as we will be sharing important updates and instructions with you. BEWARE OF SCAM! Stay tuned for more updates and announcements 👀 as we continue to make progress towards the launch of QuasarK. We appreciate your ongoing support and look forward to embarking on this exciting journey together! #QuasarK#ClosedBeta#BetaTesters#ComingSoon

Quasark.io - Announcement

@quasark_channel · Post #5 · 28.06.2023 г., 13:01

💫📝 JOIN QUASARK BETA Calling all crypto enthusiasts! We are thrilled to announce that QuasarK is to launch its closed beta and we need OGs willing to be the first to experience the power and convenience of the next-gen wallet 🙌 🔍 Become a Beta Tester and play an active role in refining and improving 💎 the wallet before its public release. And your effort will be rewarded 💰 💥 How to Join QuasarK Beta 1️⃣ Participate in this campaign: https://zealy.io/c/quazark/invite/yJwJUITfB-ehsbeVWcaOP 2️⃣ Complete all the tasks and get 'QuasarK Closed Beta' Discord role. Lucky beta testers will be selected from all holders of this role! 🚀 Don't miss this incredible opportunity to be at the forefront of crypto innovation. Join the QuasarK beta testing program ✅, contribute to the development of a game-changing multichain wallet. The number of testers is very limited, and the rewards are well-worth it! Together, let's revolutionize the way we manage our digital assets! #QuasarK#Crypto#DeFi#Web3#Beta

Quasark.io - Announcement

@quasark_channel · Post #6 · 30.06.2023 г., 12:53

🚀 Last Call for the QuasarK Closed Beta Whitelist Are you ready to experience the future of cryptocurrency wallets? The countdown is on ⏰, and we don't want you to miss out on this exciting opportunity! Here's why you want to be part of our closed beta: 1️⃣ Unrivaled Security: Quasark ensures the safety of your funds like never before. Rest easy, knowing your assets are protected. 2️⃣ User-Friendly Interface: Effortlessly navigate through features, send and receive funds, and stay in control of your financial future. 3️⃣ Cutting-Edge Features: From instant swaps to customizable interface, we've got you covered with a suite of powerful tools. 4️⃣ Prices&Market trends: Access insightful charts and information to make informed investment decisions. 👉 Don't wait any longer! Secure your spot before SUNDAY: https://zealy.io/c/quazark/invite/yJwJUITfB-ehsbeVWcaOP #Quasark#CryptoWallet#ClosedBeta#DigitalAssets#DeFi