Для тех кто пишет расширения на 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
The EPRP Rises Again: A Fearless Spirit Confronts Abiy’s Fearful Regime. Read more.
https://borkena.com/2025/12/07/ethiopia-eprp-rises-again-a-fearless-spirit-confronts-abiys-fearful-regime/#Ethiopia#politics#EPRP
EPRP Central Committee Meeting, Vows To Intensify Its Struggle For Ethiopians. Read more.
https://borkena.com/2025/11/19/eprp-central-committee-meeting-vows-to-intensify-its-struggle-for-ethiopians/#Ethiopia#Politics#EPRP
EPRP Calls For A Public Meeting In Addis Ababa. Read more.
https://borkena.com/2025/11/22/ethiopia-eprp-calls-for-a-public-meeting-in-addis-ababa/#Ethiopia#News#EPRP#PublicMeeting
News: #EPRP says politician #Yeshiwas Assefa arrested, calls for immediate release
The #Ethiopian People’s Revolutionary Party (EPRP) has announced that politician Yeshiwas Assefa has been arrested, saying it confirmed the development through his family members.
In a statement issued today, the party said Yeshiwas was taken into custody yesterday, describing the arrest as part of what it called the government’s continued crackdown on citizens engaged in peaceful political activity.
“This is one of the countless acts that demonstrate the government’s ongoing suppression of citizens engaging in peaceful political activities,” the statement read.
The EPRP further argued that such actions cast doubt on the credibility of the upcoming elections, which ruling party officials have repeatedly pledged will be free, fair and democratic. Instead, the party said, the current
https://web.facebook.com/AddisstandardEng/posts/pfbid0haYBwZFd8QeABk6i1v9kN4LtHyVXkPGG4mFcjx4T6UPUAx1SVkJ5PCi2FpXQ74Col
EPRP Press Conference on planned demonstration. Watch it.
https://borkena.com/2026/04/15/eprp-press-conference-on-planned-demonstration/#Ethiopia#News#EPRP#EthiopianNews#politics#EthiopianPolitics
EPRP Holding Its Public Meeting This Saturday In Addis Ababa. Read. https://borkena.com/2025/12/03/eprp-holding-its-public-meeting-this-saturday-in-addis-ababa/#Ethiopia#EPRP#AddisAbaba#opposition
News: #EPRP signals readiness to bypass electoral board for nationwide protests
Ethiopian People’s Revolutionary Party says it will proceed with planned demonstrations in ten cities on 8 May, 2026, even if it does not receive approval from the National Election Board of Ethiopia, citing constitutional guarantees on the right to assembly.
Speaking to Addis Standard, #Mistireslassie_Tamrat, EPRP’s General Secretary, said the party had formally notified #NEBE ahead of the planned protests but has yet to receive any response.
“Regarding the letter we submitted to the Electoral Board, we have not received any response so far; they haven’t notified us of anything, and we are still waiting,” she said.
Despite the lack of communication, Mistireslassie indicated that the party is prepared to move forward outside the electoral framework if necessary. “If this demonstration cannot proceed through the Electoral Board's framework, we will
Read more: https://addisstandard.com/?p=56537