Для тех кто пишет расширения на PyQt/PySide для CG-софтов.
Когда я только начинал писать тулзы под Maya (тогда еще версия 2010-2011) мне приходилось ручками ставить PyQt4 под Maya. Даже написал мануалы по установке на своём сайте. Но потом стал доступен из коробки PySide и позже он обновится до PySide2. Для некоторых систем была поддержка PyQt5.
И как простому разработчику поддерживать этот зоопарк? Ведь хочется чтобы тул работал на любой версии (вы тоже делали модуль что-то типа import_qt.py?😁)
На помощь приходит проект Qt.py который поставил себе цель унифицировать использование Qt-биндингов вне зависимости от среды где запускается код. Те, кто давно пишут на Qt, скорее всего знают этот проект.
Он стал стандартом для CG-индустрии и используется в топовых студиях и проектах.
Qt․py помогает запускать один и тот же код на разных платформах с разными вариантами Qt-библиотек. Это может быть как интеграция в CG-софт, так и переносимость стендалонов между разными платформами с разными версиями Python.
Я решил рассказать о некоторых особенностях работы с этой библиотекой.
Сегодня о том, как установить и использовать Qt․py и что это вам даёт.
Установка
pip install Qt.py
Чтобы начать использовать Qt․py в коде достаточно заменить импорт вашего варианта Qt-биндинга на Qt․py
from [PySide|PyQt4|PySide2|PyQt5] import QtWidgets
=>
from Qt import QtWidgets
Теперь ваш код будет поддерживать любой вариант биндинга Qt в Python.
При этом не потребуется использовать if-else конструкции под разные версии. Все вызовы теперь одинаковы.
Всё что нужно сделать, это написать его по правилам PySide2. Именно эта версия была взята за основу.
Приоритет импорта такой:
1. PySide2
2. PyQt5
3. PySide
4. PyQt4
Что именно загрузилось можно посмотреть в переменной __binding__
>>> import Qt
>>> Qt.__binding__
'PySide2'
Приоритет имопрта можно изменить через переменные QT_PREFERRED_BINDING и QT_PREFERRED_BINDING_JSON. Причем под каждый проект оверрайды можно настраивать индивидеально.
#qt#libs
🎉 Free Huge Airdrop ~ Mine Daily $OGC | OGC is Creating #web3 gaming ecosystem.
🥳 Total supply: 1Billion only
🤑 Distributing 100% of tokens to The community
👉 Register here :- https://app.ogcom.xyz/invite/HVzkGq-DiqxVjD73
➖ Register With Email
➖ Verify email & Mine daily
✅ Partnership With Dmailofficial & thenotcoin
⚡️ Voltage Finance is now fully charged, powered by Integral!
The latest Modular CLAMM tech from Algebra—Integral—is live on Fuse Network, the most business- and consumer-friendly blockchain ecosystem for mainstream #Web3 payment adoption.
What’s in store?
🎨 Custom liquidity pools with v4 plugins
⚡ Concentrated liquidity for precise LP strategies
🧨 Dynamic fees that adapt to the market
And so much more! Thus, another DEX joins the growing Algebra CLAMM infrastructure! 💪🏻
🚀 Wallet Agents are LIVE on TRON!
The first protocol on TRON built using MCP tech to enable seamless AI × Wallet interactions.
🔗 Open-source
🧠 AI-ready
⭐️ Decentralized
We’re building the gateway for AI-native dApps to securely connect wallets, sign transactions, and interact on-chain — starting with TRON.
AI builders, let’s shape the future of #Web3 on TRON!
👉https://mcp.tp.xyz/
WEB3 Portal: learn Web3 and Earn!
📱 Discover an innovative approach to learning and working. WEB3Portal is the perfect start in the $TON ecosystem. The goal of the project is to simplify the world of Web3 and make it accessible to everyone.
🔋Learn-to-Earn: Complete tasks, gain valuable skills, and put them into practice immediately.
🔋Real rewards: earn $WebPoints. Compete with other users for the top spot in the leaderboard!
🔋TON tokenexchange , analytics , charts and profitable staking offers - the entire #Web3 ecosystem is now in one application.
🧐Start completing tasks and get over 10,000 WebPoints!
🤝Gamety x Carbon Ventures Stategic Partnership!
We’re excited to announce Gamety’s partnership with CarbonVentures – a new venture fund by trycarbonio, empowering the future of #Web3 innovation.
This Means:
🤔 Backing #Web3 Founders to accelerate growth
🤔 Expanding possibilities within the Gamety Ecosystem
Together with Carbon Ventures, we’re taking Gamety to new heights in the Web3 space.
Stay tuned – the future is here!
Spread the hype! Like, RT, and drop a comment: Tweet 🕊
📎Important Links:
Website | X | Chat (FULL) | Indonesian Chat | African Chat | Vietnamese Chat | CIS Chat | Discord | Announcement | YouTube | Medium | New Bot
GameFi.org & Eragon
💡We are excited to announce a new partnership with Eragon, the ultimate development and distribution platform for Web3 Mobile Games, powered by AI solution. Backed by Aptos, and Sotatek ERAGON offers an unparalleled solution for developers, gamers, and investors.
🤝The partnership will include group gameplays, #Web3 discussions, and competitions in which both of our communities can participate.
📢With the help of Eragon, Game Hub will continue to play a leading role in the GameFi.org ecosystem in Web3 history.
😎 GM fam! How do you spend your time in the mornings? Cause we've got a deal! 🤝
Nomis is in GG22 #Web3 Infrastructure Program, and we need your morning energy ⚡️
- Share the post
- Call frens for support
- Donate ANY amount of $ to drive our cause!
How to donate? It's a breeze:
1. Connect your wallet
2. Add Nomis to your cart 🛒
3. Choose the donation amount (even $1 is enough for us
💜)
4. Submit the payment and make your impact!
The full guide, just in case
SHOW YOUR LOVE
💜👇
We're happy to announce the launch of our sentry nodes on XAI, the world’s first Layer 3 solution for AAA gaming 🎮
As a part of our commitment to XAI's growth and our 2024 strategy to become an active participant in the creation of a more secure and decentralised gaming ecosystem, we are launching our sentry nodes on XAI! 🚀
Looking forward to this exciting journey towards more decentralized and user-friendly #Web3 games! 💪
Congratulations to the shortlisted participants of our Web3 Unleashed: Crypto Innovation Challenge with Bybit x DMCC!
We're excited to be here on the Live Pitching Day where they will showcase their ground-breaking #Web3 projects 🚀
Learn more: https://hubs.li/Q029qjbH0