Для тех кто пишет расширения на 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
"‘We Need More Angry Young Women’ To End Israeli #Genocide Of #Gaza... And Fewer Angry, Old, White Politicians."
Climate Activist and Gaza #FreedomFlotilla volunteer Greta Thunberg’s response to Trump’s assertion that she needs anger management.
By Ann Wright, in Popular Resistance.
https://popularresistance.org/we-need-more-angry-young-women-to-end-israeli-genocide-of-gaza/
The focus wasn't just on fat black lesbians for #DEI pilots. The shocking criteria in this report clearly expose the #genocide agenda.
https://youtu.be/4JJVyjG3QDQ?si=rySFDl56oxNmYBEl
Ethiopia’s PM Used the Language of Genocide : The World Should Pay Attention. Read. https://borkena.com/2025/12/10/ethiopias-pm-used-the-language-of-genocide-the-world-should-pay-attention/#Ethiopia#politics#humanrights#genocide
Quanto accade a Gaza è un GENOCIDIO, condotto da un governo di criminali: mi rendo conto che per il direttore di qualche bollettino (definirlo telegiornale è troppo) sia dura da mandare giù, ma tant'è.
I peggiori però sono quelli che oggi parlano di libertà di espressione a rischio: sono gli stessi che ci accusavano di essere fiancheggiatori di Hamas o di essere putiniani.
La mia al TG Plus di Cusano Italia TV
#genocide#Genocidio#Palestina#guerra#pace
https://www.youtube.com/watch?v=MyB-BMQAeIQ&ab_channel=SavinoBalzano
After 466 days of #genocide, #Israel and #Hamas agreed to a deal to halt fighting in #Gaza and exchange Israeli hostages for Palestinian prisoners. This deal opens the way to a possible end to a 15-month war that has upended the Middle East.
The agreement follows months of on-off negotiations brokered by Egyptian and Qatari mediators, with the backing of the United States, and came just ahead of the Jan. 20 inauguration of U.S. President-elect Donald Trump.
Genocide, Ethnic Cleansing, and the Criminalization of Civilian Life in Ethiopia. Read more.
https://borkena.com/2026/01/29/ethiopia-genocide-ethnic-cleansing-and-the-criminalization-of-civilian-life/#Genocide#ethniccleansing#Ethiopia
☠️💀 While Bovaer is front and centre atm we need to also ask our dairy and meat suppliers if they are using RUMIN8 on their cattle......
Check out what RUMIN8 really is.....😳🙄🧐
Highly toxic to animals and humans....😡🤨
#climatechangehoax#depopulation#genocide
https://t.me/hiddeninplainsight1
Herzi Halevi, the Chief of Staff of the Israeli Occupation Forces, visits the frontlines of the military operation in the #WestBank, stating, "We are here for Israel's security."
Tell us again how this is NOT a #Genocide
And point to us wehre the HELL is #Hamas in the West Bank you genocidaires.
"They're forcing us to murder their innocent children!!!"
Yeah, sure, of course ..... You #Israelis are obviously the real victims here!!!
#Gaza
#Genocide
Another sign of the intentional destruction of civilisation. In 2024 Trafalgar Square's Fourth Plinth will be surrounded by the casts of 850 tranny prozzies!!
A monstrosity created by Mexico's answer to Yoko Ono, the smokescreen tranny agenda keeps the #paedophilia, #transhumanism and #genocide trains chugging.
https://artsandculture.google.com/story/850-improntas-850-imprints-mayor-of-london/VQWhmzmLR4DD5Q?hl=en
https://youtu.be/3CIuRLfmNuI