Для тех кто пишет расширения на 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
To clarify, in the post about the Bulcoin Referral Program, by "invitation to the channel" we meant subscription to the channel. To receive rewards, those who wrote your username in the comments must be subscribed
#referrals
FAQ | BUY
Now is the best time to enter BLC Market.
Early stage project:
- actively forming structure
- interfaces are being published
- new mechanics are opening up
If you're already here - you're getting in ahead of most.
Scaling will follow next.
#community#referrals
FAQ | BUY
👥 The system of inviting friends to CITY Holder! 🏠🐹
With the invitation system you get in-game income not only for inviting friends, but also for their further development! The better your buddy's results, the higher your income. Combine strategies and show incredible results! #CITYHolder#Referrals
https://t.me/cityholder🆕👈
°°°°°°
Launching the BulCoin Referral Program
We are starting a referral program for the early BulCoin community.
Now every participant can invite friends to the project and receive additional bonuses.
How it works:
Invite your friends to the BulCoin channel
Ask them to mention your username in the comments to this post
Bonuses BLC are credited for invitations
Rewards:
• 3 invited — You join the private Pioneers chat
• 10 invited — Bonus of 500,000 BLC
• 25 invited — 3mln BLC + Participation in the BulCoin operational staff
We will regularly publish the leaderboard — participants who have invited the most people.
The best participants can receive additional rewards and a special status in the community.
This is just the beginning of the formation of the BulCoin Early Community
Invite your friends and help build the BulCoin community
#Pioneers#Referrals
FAQ | BUY
Invitation mechanics in BLC Market
There will be a separate section in the app through which you can invite new users.
This will allow:
— community to grow faster
— build connections between members
— increase activity within the platform
We will show the interface in the upcoming updates.
#profile#community#referrals
FAQ | BUY
🎉 Invite Reward Boost! 🎉
Invite friends to join SingSing and earn 20 $KARA FREE for each successful invite (up from 10 $KARA)! 🔥
👥 The more, the merrier – stack up your $KARA effortlessly!
💸 Start inviting now and claim your rewards!
#SingSing#KARA#Invite#Referrals
🎤Announcement | Chat | X (Twitter) | Website | Game