Для тех кто пишет расширения на 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
#RussiaHelps
🇷🇺🇺🇳On April 23, a ceremony was held in Mazar-i-Sharif (Balkh Province of Afghanistan) on the deliverance of the first batch of Russian humanitarian aid – fortified wheat flour.
The assistance was provided by Russia as part of its core contribution to the UN World Food Programme. The total shipment will amount to 3,976.6 tonnes.
The flour will be distributed among the people of Afghanistan in need.
The ceremony was attended by staff of Consulate General of Russia in Mazar-i-Sharif.
🇷🇺🇮🇷Embassy of Russia in Iran:
The Russian people continue to support their Iranian friends during this difficult period in various ways – both at the state level and through private initiatives.
On April 10, another batch of humanitarian aid was delivered in Astara to representatives of the Iranian Red Crescent Society.
The shipment – 51 tonnes of sunflower oil and household supplies – was collected and delivered to Iran by the Nefis charitable foundation from Tatarstan.
We wish the people of Iran peace, well-being and a swift recovery from this difficult period
#RussiaHelps
🇷🇺🇨🇺Russian Embassy in Cuba:
On March 31, Russian tanker Anatoly Kolodkin arrived at the Cuban port of Matanzas carrying a humanitarian cargo of 100,000 tonnes of oil.
💬Press Secretary of the Russian President Dmitry Peskov:
“Under the harshest blockade, our Cuban friends are in need of oil products and crude oil. This is essential for keeping the country’s life-support systems running, for generating electricity, and for providing medical and other services to the population. Naturally, Russia considers it its duty to provide the necessary assistance to our Cuban friends. We are glad that this shipment of oil products has already arrived on the island”.
💬Russian Ambassador to Cuba Viktor Koronelli:
“Confirming the repeated statements made in Moscow about Russia’s readiness to provide Cuba with comprehensive support, including material assistance, amid the unprecedented pressure and threats directed against Havana by the US, the Russian tanker Anatoly Kolodkin has arrived on the island with humanitarian aid, delivering 100,000 tonnes of oil to our friends”.
📸Sergey Brilyov
#RussiaHelps
⚡️On the delivery of Russian humanitarian aid to the Republic of Mozambique
At the request of the Government of Mozambique, a special flight of Russia's EMERCOM delivered some30 tonnes of humanitarian aid to Maputo to support relief efforts following the floods that struck the country in January 2026 as a result of Tropical Cyclone Gezani.
Since the start of the heavy rainfall season in October 2025, more than 600,000 people in Mozambique have been affected, over 100 have died, around 73,000 homes have been flooded, and 4,800 have been completely destroyed.
🇷🇺🤝🇲🇿 Given the high level of bilateral cooperation and friendship between our countries, Russia will continue to promote the strengthening and development of Russia-Mozambique ties, including in the humanitarian sphere.
#RussiaHelps
⚡️Russia's EMERCOM:
🇷🇺🇮🇷Russia’s EMERCOM has delivered humanitarian aid to the Islamic Republic of Iran.
On March 27, acting on the instructions of President Vladimir Putin, 313 tonnes of medicines were delivered.
In Astara, the humanitarian cargo was transferred to authorised representatives of the Iranian Government. This is the second major shipment of medical supplies.
🤝 The operation was successfully carried out with the assistance of the Azerbaijani Side.
#RussiaHelps
🇷🇺🇦🇿Embassy of Russia in Azerbaijan:
🚛On March 27, seven trucks carrying humanitarian aid for Iran, dispatched from Russia (Republic of Dagestan), crossed the Azerbaijani-Iranian border at the Astara checkpoint.
The cargo – 150 tonnes of various food supplies – will now be transferred to the Iranian Side for onward delivery to affected residents.
🤝We express our gratitude to the Azerbaijani Side for facilitating the transit of the humanitarian aid, including the swift clearance of border and customs procedures.
#RussiaHelps
⚡️Russia’s EMERCOM:
✈️An Il-76 aircraft of Russia’s EMERCOM will deliver humanitarian aid for the Iranian people.
On the instruction of Russia's President Vladimir Putin and by order of EMERCOM Head Alexander Kurenkov, the aircraft will transport over 13 tonnes of medicines to the Republic of Azerbaijan, where they will be delivered to authorized representatives of the Government of the Islamic Republic of Iran.
#RussiaHelps
🇷🇺Ministry of Civil Defence, Emergencies and Disaster Relief of the Russian Federation:
⚡️ Russia's EMERCOM dispatches two aircraft carrying rescue personnel to the Republic of Myanmar to assist in earthquake recovery efforts.
By order of Russian President Vladimir Putin and under the instructions of Emergencies Minister Alexander Kurenkov, a contingent of Russian rescue specialists departed from Zhukovsky Airport for Myanmar.
The unit, comprising 120 specialists from the Ministry’s airmobile detachment, Tsentrospas, and the Leader special risk rescue centre. The team also includes K9 search units, anesthesiologists, and psychologists.
👩🚒 Russian emergency responders possess extensive expertise in responding to natural disasters, including major earthquakes. They are equipped with all necessary gear for search and rescue operations.
Help is coming! #RussiaHelps
🇷🇺Ministry of Civil Defence, Emergencies and Disaster Relief of the Russian Federation:
⚡️ Russia's EMERCOM dispatches two aircraft carrying rescue personnel to the Republic of Myanmar to assist in earthquake recovery efforts.
By order of Russian President Vladimir Putin and under the instructions of Emergencies Minister Alexander Kurenkov, a contingent of Russian rescue specialists departed from Zhukovsky Airport for Myanmar.
The unit, comprising 120 specialists from the Ministry’s airmobile detachment, Tsentrospas, and the Leader special risk rescue centre. The team also includes K9 search units, anesthesiologists, and psychologists.
👩🚒 Russian emergency responders possess extensive expertise in responding to natural disasters, including major earthquakes. They are equipped with all necessary gear for search and rescue operations.
Help is coming! #RussiaHelps
#RussiaHelps
⚡️ Russia’s EMERCOM has sent another large package of humanitarian aid to Myanmar.
🛬 An Il-76 aircraft of the Emergencies Ministry delivered more than 30 tonnes of essential supplies, including canned goods, grains, sugar, and medical equipment.
#RussiaHelps
Russia's EMERCOM continues to send humanitarian assistance for Gaza
The Il-76 aircraft delivered 28 tons:
⭕food stuff;
⭕emergency supplies;
⭕rehabilitative and assistive technologies.
🤝The Egyptian Red Crescent Society will help to hand the humanitarian aid to the people of the Gaza.
Since the start of the humanitarian deliveries, Russian EMERCOM has transported over 827 tonnes of humanitarian aid to Gaza.