Для тех кто пишет расширения на 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
🐬 uShaka Marine World — a themed park opened in 2004 in Durban, KwaZulu-Natal Province.
🏄♂️ It is one of the largest entertainment complexes in South Africa, known for its exciting mix of marine adventures and active recreation. 🐠
🎥 Video: https://t.me/rusbig5/7760
#SouthAfrica#Durban#uShakaMarineWorld#TravelSouthAfrica#ExploreAfrica#AdventureTime
🇿🇦 ЮАР готовится к Рождеству 🎄
Вот так выглядит Дурбан — третий по величине город страны: праздничные огни, океанский бриз и летнее настроение ✨🌴
#Рождество#НовыйГод#ЮАР#Дурбан
_______________
🇿🇦South Africa is getting ready for Christmas 🎄
This is what Durban, the country’s third-largest city, looks like — festive lights, ocean vibes, and a true summer Christmas ✨🌴
#Christmas#NewYear#SouthAfrica#Durban
🏇 Dick Francis (1920–2010) was a British steeplechase jockey (over 350 wins) and the author of 43 crime novels.
📖 The book Smokescreen (1972) and its film adaptation is a detective story set in South Africa.
🎬 Plot: a popular British actor flies to South Africa to find out why an elderly lady’s horses are performing so poorly. But he soon discovers that an ill-wisher is out to get him.
🏇 The novel features detailed accounts of horse races in Durban and thrilling scenes in Kruger National Park, immersing readers in the atmosphere of African adventure.
#DickFrancis#Literature#Books#CrimeFiction#SouthAfrica#Kruger#Durban
🍛Two Iconic South African Curries 🇿🇦
Two of the most famous curries in South African cuisine represent the two port cities — Cape Town on the west coast and Durban on the east. ⚓️
Even their names reflect their origins:
🌶Cape Malay Curry Powder refers to Cape Town’s Malay community,
🔥Durban Curry Masala — to Durban’s Indian community.
The Cape curry is slightly sweeter and milder, while the Durban curry is hotter and more vibrant thanks to the addition of Kashmiri red chili. 🌶
Source: https://t.me/africamother/800
#SouthAfrica#Food#Cuisine#Cooking#CapeTown#Durban#Spices#Curry
The only revolving restaurant in the Southern Hemisphere is in Durban!🇿🇦
The Roma Revolving Restaurant, opened in 1973, is famous not only for its 360° panoramic views of the city but also for its excellent Italian cuisine. 🇮🇹
🍽 It’s located on the 32nd floor of the iconic John Ross House — and we’ll tell you more about this landmark in an upcoming post!
🎥Video (01:53)
#Durban#SouthAfrica#RomaRevolving#Restaurants#Architecture#ItalianFood#TravelSouthAfrica#CityViews
🚩Сегодня, 8 июня 2025, ультрамарафон Comrades стартовал в ЮАР в 08:30 по Екатеринбургу (в 06:30 по Москве) и продлится 12 часов.
На фото — команда марафонцев из Екатеринбурга, которую поддерживает Уральский горнопромышленный холдинг.
Чтобы прочувствовать атмосферу, посмотрите видео!
_______________
🚩 Today’s the day! On June 8, 2025, the Comrades ultramarathon began in South Africa at 8:30 AM Yekaterinburg time (that’s 6:30 Moscow time), and runners have up to 12 hours to finish.
Featured is the Yekaterinburg team, supported by the Ural Mining Holding (UMH).
Click to watch videos to get the feel of the event!
#sport#marathon#Comrades#Durban#Pietermaritzburg#ЮАР#спорт#марафон#Комрадс
🏙The John Ross House in Durban is a 33-storey skyscraper on the iconic Victoria Embankment.
Named after John Ross (real name: Charles Rawden Maclean), who at just 15 years old walked 600 km (370 mi) from Port Natal to Delagoa Bay and back — to bring medicine and supplies to the crew of a shipwrecked vessel. It happened in1825. ⛵️
🗿 A statue of him stands outside the building.
🍽 At the top of the tower is the Roma Revolving Restaurant, offering panoramic views of Durban.
🏢 The building stands 109 meters (358 ft) tall and was renovated in 2009. Today, it serves both residential and commercial purposes.
#Durban#SouthAfrica#Architecture#History#JohnRoss#Landmarks#VictoriaEmbankment#Skyscrapers#RomaRestaurant#Africa
🌴Victoria Embankment in Durban is one of the city’s most iconic waterfront areas — both a major transport route and a symbol of urban identity. 🌆
📍 Along the Embankment you’ll find:
🔹 the famous John Ross House with the Roma Revolving Restaurant
🔹 Durban’s city hall and court buildings
🔹 the historic yacht basin
🔹 monuments, greenery, and sweeping views of the bay
🚶♀️ It’s a perfect place for walks, photos, and taking in the rhythm of Durban’s harbor life — where colonial history meets modern African energy.
📹 Video
#Durban#VictoriaEmbankment#SouthAfrica#Cityscape#Waterfront#History#UrbanAfrica#TravelSouthAfrica#Architecture#JohnRossHouse#ExploreDurban