Для тех кто пишет расширения на 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
#photo#SouthSudan
The world’s newest country, South Sudan, marked a decade of independence this month, but it’s still one of the world’s poorest nations, scarred by war and hunger.
South Sudan gained independence in 2011, but an intertribal conflict broke out two years later that escalated into a full-blown civil war which has crippled the country’s economy and agriculture.
This Red Cross station in Kobok was the only place where people in South Sudan’s Upper Nile region could get medical help, make phone calls, or simply get something to eat. The Red Cross staff treated all patients equally, regardless of whether they were soldiers or civilians.
Unfortunately, the hospital was destroyed by government forces three weeks after our crew filmed it.
Follow: https://t.me/rtdocumentary
🇨🇳#China - 🇸🇸#SouthSudan: Chinese troops from the 12th Chinese Peacekeeping Infantry Battalion under UNMISS (UN mission in South Sudan) conducted live-fire training in South Sudan last week.
UNMISS has been in the country since 2011 to protect civilians and support stability. The Chinese contingent previously drew major attention after the July 2016 Juba violence, when internal UN findings said Chinese and Ethiopian peacekeepers did not leave their bases to assist civilians despite orders to intervene.
An aid workers’ compound only a few hundred meters from a UN base received no help despite repeated distress calls and a survivor personally reaching the base and pleading for help. Multiple civilians, as well as a journalist, were killed during the clashes at that time.
🇷🇺🇸🇸 The Ambassador of Russia to South Sudan, A.Kosmodemiyanskiy, met with the Minister of Presidential Affairs of South Sudan, Africano Mande Gedima.
🔸 During the friendly and constructive discussion, current issues of bilateral relations were addressed.
🔸A.Kosmodemiyanskiy handed over to the Minister a copy of the personal invitationfrom the President of the Russian Federation, Vladimir Putin, to the President of South Sudan, Salva Kiir Mayardit, to attend the Third Russia-Africa Summit, which will take place in Moscow in October this year.
🔸 Following the meeting, the parties agreed to expand political, economic, and cultural cooperation between the two countries, as well as to arrange training in Russia for staffof the National Elections Commission of South Sudan in preparation for the upcoming presidential elections in December this year.
#Africa#Russia#SouthSudan
Ethiopia, South Sudan To Fast Track Implementing Agreements. Read more.
https://borkena.com/2026/04/26/ethiopia-south-sudan-to-fast-track-implementing-agreements/#Ethiopia#SouthSudan#SouthSudanNews#EthiopianNews#economicintegration#cooperation
Africa Cup of Nations - Qualification🌍
2026-03-29 13:00 UTC
South Sudan vs. Djibouti
Predicted outcome: South Sudan❌
Predicted score: 4:0
Actual: Djibouti 0:1
#SouthSudan#Djibouti
2026-03-29 15:00 UTC
Lesotho vs. Seychelles
Predicted outcome: Draw❌
Predicted score: 0:0
Actual: Lesotho 2:1
#Lesotho#Seychelles
#Football#AfricaCupofNations
Africa Cup of Nations - Qualification🌍
2026-03-26 13:00 UTC
Djibouti vs. South Sudan
Predicted outcome: South Sudan✅
Predicted score: 1:3
Actual: South Sudan 0:4
#Djibouti#SouthSudan
2026-03-26 14:00 UTC
Seychelles vs. Lesotho
Predicted outcome: Lesotho❌
Predicted score: 0:2
Actual: Draw 0:0
#Seychelles#Lesotho
#Football#AfricaCupofNations