Для тех кто пишет расширения на 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
🔥NEW RELEASE🔥
😁Only Way Out: Dynamic Back Escapes By Brian Glick😁
➡️Unlock your path to freedom with Only Way Out: Dynamic Back Escapes by Brian Glick, one of the most sought-after instructors at BJJ Fanatics. Brian’s teaching ability is renowned for breaking down complex techniques into easily digestible steps, helping practitioners at all levels of Brazilian Jiu-Jitsu (BJJ) master the art of escaping back control.
➡️Whether you're a white belt or a seasoned competitor, Brian's step-by-step breakdowns will give you the tools to confidently escape back control in any situation
➡️This instructional covers a variety of dynamic back escapes, teaching you how to stay calm under pressure and develop the instincts needed to reclaim control.
$197😍$19.99😍
❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️
📱Payment: 📱📱📱
💰Submeta FOR FREE
🌈UFC Picks
👑MasterClass
✈️@bjjfanaticsinstructionals
#BrianGlick#BJJFanatics#NewWave#NoGi#Danaher
💁♀️Buy
💁♀️
🔥NEW RELEASE🔥
😁Master The Move: The Side Crucifix By John Danaher😁
➡️Unlock the power of the Side Crucifix with John Danaher in this must-have instructional video from his best-selling "Master The Move" series
➡️With clear, step-by-step instructions, John reveals the fundamental principles behind the Side Crucifix, a position that allows you to dominate your opponent with high-percentage attacks, all without requiring advanced athletic ability.
➡️If you want to improve your upper body submission game and finish your opponents with efficiency and precision, the Side Crucifix is your new go-to position
$197😍$19.99😍
❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️
📱Payment: 📱📱📱
💰Submeta FOR FREE
🌈UFC Picks
👑MasterClass
✈️@bjjfanaticsinstructionals
#JohnDanaher#BJJFanatics#NewWave#NoGi#Danaher
💁♀️Buy
💁♀️
🔥NEW RELEASE🔥
😁The Ultimate Guide To Creating Back Exposure By Luke Griffith😁
➡️Unlock the secrets to dominating your opponent’s back in Brazilian Jiu-Jitsu with The Ultimate Guide To Creating Back Exposure by Luke Griffith, one of the most promising talents to emerge from Team New Wave.
➡️In this exclusive instructional, Luke takes you through the critical principles and strategies behind creating back exposure, a pivotal aspect of the modern submission game.
➡️Whether you’re a white belt or a seasoned black belt, this guide will sharpen your ability to find and capitalize on back control from a variety of positions.
$147😍$14.99😍
❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️
📱Payment: 📱📱📱
💰Submeta FOR FREE
🌈UFC Picks
👑MasterClass
✈️@bjjfanaticsinstructionals
#LukeGriffith#BJJFanatics#NewWave#Danaher
💁♀️Buy
💁♀️
🔥NEW RELEASE🔥
😁Leg Locks Finishes By Helena Crevar😁
➡️Unlock the secrets to finishing leg locks with Leg Locks Finishes, the highly anticipated Brazilian Jiu-Jitsu instructional by the rapidly rising star of the sport, Helena Crevar.
➡️Her impeccable technique, precise attention to detail, and aggressive competition record make her the perfect guide to take your leg lock game to the next level.
➡️In this comprehensive instructional, Helena breaks down her favorite leg lock finishes, focusing on efficient setups, seamless transitions, and perfecting the art of submission under pressure.
$197😍$14.99😍
❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️
📱Payment: 📱📱📱
💰Submeta FOR FREE
🌈UFC Picks
👑MasterClass
✈️@bjjfanaticsinstructionals
#HelenaCrevar#WomenBJJ#Leglocks#NoGi#Danaher
💁♀️Buy
💁♀️
🔥NEW RELEASE🔥
😁Leg Lock Entries By Helena Crevar😁
➡️Unlock the power of leg locks with Helena Crevar's BJJ Instructional on Leg Lock Entries. As one of the fastest rising stars in Brazilian Jiu-Jitsu, Helena has been turning heads worldwide with her technical precision and mastery of the game
➡️Trained under the legendary John Danaher, Helena’s leg lock game is among the best in the world. This instructional video provides you with clear, step-by-step guidance on entries that will elevate your leg lock game to new heights.
➡️This is your opportunity to learn from one of the brightest talents in BJJ and take your leg lock entries from basic to lethal.
$197😍$14.99😍
❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️
📱Payment: 📱📱📱
💰Submeta FOR FREE
🌈UFC Picks
👑MasterClass
✈️@bjjfanaticsinstructionals
#HelenaCrevar#WomenBJJ#Leglocks#NoGi#Danaher
💁♀️Buy
💁♀️