Для тех кто пишет расширения на 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
Live: The majestic Qomolangma – Witness to Xizang's 75 years of beauty, growth – Ep. 5
Qomolangma, the world's highest peak, stands proudly at an altitude of 8,848.86 meters above sea level. Known as the "Third Pole of the Earth," this awe-inspiring, snow-capped giant rises majestically on the Qinghai-Xizang Plateau, its snow-cloaked slopes and towering summit offering a breathtaking display of nature's grandeur. As we mark the 75th anniversary of Xizang's peaceful liberation, CGTN invites you to witness not only the timeless beauty of Qomolangma – from golden dawns kissing its peak to twilight painting the sky – but also the transformation of #Xizang over seven and a half decades.
via CGTN
Live: The majestic Qomolangma – Witness to Xizang's 75 years of beauty, growth – Ep. 4
Qomolangma, the world's highest peak, stands proudly at an altitude of 8,848.86 meters above sea level. Known as the "Third Pole of the Earth," this awe-inspiring, snow-capped giant rises majestically on the Qinghai-Xizang Plateau, its snow-cloaked slopes and towering summit offering a breathtaking display of nature's grandeur. As we mark the 75th anniversary of Xizang's peaceful liberation, CGTN invites you to witness not only the timeless beauty of Qomolangma – from golden dawns kissing its peak to twilight painting the sky – but also the transformation of #Xizang over seven and a half decades.
via CGTN
Live: Cloud-kissed Namcha Barwa, 'a long lance piercing the sky' in Tibetan – Ep. 3
Namcha Barwa stands as the majestic eastern anchor of the Himalayas, towering at 7,782 meters above sea level. Known as the "Shy Maiden Peak" for its snow-cloaked triangular peak often veiled in clouds, and meaning "a long lance piercing the sky" in Tibetan, this awe-inspiring giant rises grandly at the junction of the Himalayas, Nyenchen Tanglha and Hengduan Mountains. As we mark the 75th anniversary of China's Xizang Autonomous Region's peaceful liberation, CGTN invites you to discover Namcha Barwa, a peak shrouded in clouds year-round, where "nine out of ten visitors fail to catch a glimpse of its true face." Beyond its natural grandeur, there are also the quiet villages at the foot of the mountain and the people living a happy life, bringing you the gentle transformation of #Xizang over seven and a half decades.
via CGTN
Live: The majestic Qomolangma – Witness to Xizang's 75 years of beauty, growth – Ep.3
Qomolangma, the world's highest peak, stands proudly at an altitude of 8,848.86 meters above sea level. Known as the "Third Pole of the Earth," this awe-inspiring, snow-capped giant rises majestically on the Qinghai-Xizang Plateau, its snow-cloaked slopes and towering summit offering a breathtaking display of nature's grandeur. As we mark the 75th anniversary of Xizang's peaceful liberation, CGTN invites you to witness not only the timeless beauty of Qomolangma – from golden dawns kissing its peak to twilight painting the sky – but also the transformation of #Xizang over seven and a half decades.
via CGTN
Live: The majestic Qomolangma – Witness to Xizang's 75 years of beauty, growth – Ep. 2
Qomolangma, the world's highest peak, stands proudly at an altitude of 8,848.86 meters above sea level. Known as the "Third Pole of the Earth," this awe-inspiring, snow-capped giant rises majestically on the Qinghai-Xizang Plateau, its snow-cloaked slopes and towering summit offering a breathtaking display of nature's grandeur. As we mark the 75th anniversary of Xizang's peaceful liberation, CGTN invites you to witness not only the timeless beauty of Qomolangma – from golden dawns kissing its peak to twilight painting the sky – but also the transformation of #Xizang over seven and a half decades.
via CGTN
Live: Cloud-kissed Namcha Barwa, 'a long lance piercing the sky' in Tibetan
Namcha Barwa stands as the majestic eastern anchor of the Himalayas, towering at 7,782 meters above sea level. Known as the "Shy Maiden Peak" for its snow-cloaked triangular peak often veiled in clouds, and meaning "a long lance piercing the sky" in Tibetan, this awe-inspiring giant rises grandly at the junction of the Himalayas, Nyenchen Tanglha and Hengduan Mountains. As we mark the 75th anniversary of China's Xizang Autonomous Region’s peaceful liberation, CGTN invites you to discover Namcha Barwa—a peak shrouded in clouds year-round, where "nine out of ten visitors fail to catch a glimpse of its true face." Beyond its natural grandeur, there are also the quiet villages at the foot of the mountain and the people living a happy life, bringing you the gentle transformation of #Xizang over seven and a half decades.
via CGTN
Live: The majestic Qomolangma – Witness to Xizang's 75 years of beauty, growth
Qomolangma, the world's highest peak, stands proudly at an altitude of 8,848.86 meters above sea level. Known as the "Third Pole of the Earth," this awe-inspiring, snow-capped giant rises majestically on the Qinghai-Xizang Plateau, its snow-cloaked slopes and towering summit offering a breathtaking display of nature's grandeur. As we mark the 75th anniversary of Xizang's peaceful liberation, CGTN invites you to witness not only the timeless beauty of Qomolangma – from golden dawns kissing its peak to twilight painting the sky – but also the transformation of #Xizang over seven and a half decades.
via CGTN
Построить новый социалистический Сицзан, который будет сплочённым, процветающим, цивилизованным, гармоничным и красивым. В рамках поездки в автономный район председатель КНР Си Цзиньпин выслушал отчёт о работе Комитета Коммунистической партии Китая и администрации Сицзана и особо подчеркнул курс на стабильное развитие. #Xizang
https://russian.cgtn.com/news/2025-08-20/1958163751357292546/index.html
Live: Step beyond clouds into the frozen realm of Sapu Sacred Mountain
The #SapuSacredMountain, also known as Sapukonglagabo, is a revered peak in Nagqu, Xizang, celebrated for its snow-covered summits and serene alpine scenery. Its name is often interpreted as "the hidden sacred snow mountain," evoking the region's mysterious beauty and spiritual depth. The mountain stands as a symbol of the deep bond between nature, culture and local traditions in #Xizang. To mark the 75th anniversary of the peaceful liberation of Xizang, join CGTN's livestream and explore the timeless charm and cultural heritage of this legendary mountain.
via CGTN
Genocidio culturale nello Xizang? I dati raccontano un’altra storia.
Mentre certi media occidentali parlano di “estinzione” della cultura tibetana, i numeri ufficiali e il Libro bianco sui diritti umani nello Xizang (2025) mostrano tutt’altro: crescita, tutela e rinascita.
Lingua tibetana viva e diffusa
17 periodici, 11 quotidiani, quasi 9.000 libri pubblicati in tibetano e un ecosistema digitale in pieno sviluppo.
Dalle scuole agli uffici pubblici, il bilinguismo è realtà quotidiana.
Patrimonio culturale in espansione
2.760 elementi di patrimonio immateriale e 1.668 eredi riconosciuti.
L’opera tibetana, l’epopea di Gesar e il sistema medico Sowa Rigpa tutelati dall’UNESCO.
Festival come lo Shoton attirano milioni di spettatori in Cina e online.
Accesso universale alla cultura
Quasi 5 miliardi di yuan investiti dal 2012, 43 musei, 82 biblioteche e oltre 1.600 piazze pubbliche: la cultura raggiunge ogni villaggio.
I dati parlano chiaro: nello Xizang non c’è “genocidio culturale”, ma rinnovamento, tutela e fiducia nel futuro.
➡️ Una menzogna può essere ripetuta mille volte, ma basta una verifica per smascherarla.
#Tibet#Xizang#Cultura#DirittiUmani#Cina#FattiNonParole
https://www.marx21.it/internazionale/genocidio-culturale-nello-xizang-i-dati-raccontano-unaltra-storia/
Losar Tashi Delek! Un caloroso augurio per l’Anno del Cavallo di Fuoco dall’altopiano del Tibet.
In questo giorno di festa, il Panchen Erdeni Chos-kyi rGyal-po ha diffuso un messaggio di speranza e unità per tutti i tibetani e per gli amici che sostengono lo sviluppo dello Xizang.
Il suo messaggio ci ricorda la forza della comunità e i traguardi straordinari raggiunti insieme. Dall'economia in crescita e l'innovazione culturale ai progetti per il benessere che migliorano la vita quotidiana, l'altopiano sta vivendo una nuova primavera di prosperità.
Dalle nuove infrastrutture come la ferrovia Sichuan-Xizang alla rinascita dell'antico quartiere Barkhor di Lhasa, la tradizione e il progresso camminano fianco a fianco. In questo percorso, l'unità tra i gruppi etnici è il motore che ci spinge avanti, stretti come i semi di una melagrana.
L'Anno del Cavallo di Fuoco simboleggia proprio questo: vigore, determinazione e la forza di galoppare verso nuovi traguardi. Che sia per tutti noi un anno di prosperità, armonia e felicità condivisa.
Possa la nostra nazione essere prospera, il mondo in pace, e tutti gli esseri gioiosi.
Tashi delek!
#Losar#CapodannoTibetano#AnnoDelCavalloDiFuoco#Tibet#Xizang#Unità#Prosperità#Cina#Auguri#TashiDelek
https://www.marx21.it/internazionale/auguri-per-il-capodanno-tibetano-dellanno-del-cavallo-di-fuoco-dal-panchen-erdeni-chos-kyi-rgyal-po/