Для тех кто пишет расширения на 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
Trump's $TRUMP coin surges 30% after exclusive dinner invite for top holders announced.
The event, hosted at his golf club, fuels trading frenzy and ethical debates.
#TrumpCoin#CryptoPolitics
🖼 Trending now: #CryptoPolitics - Major crypto firms back Trump’s White House fundraiser. #Regulation#USPolitics
🇺🇸 最新消息:Coinbase、Ripple、Tether 以及 Winklevoss 雙子星等多家加密企業,均為川普白宮宴會活動的主要捐助者之一。
此舉被視為加密產業加強與政治接軌的關鍵信號,或將影響未來監管與政策走向。 #Insight
@EthereumGlobalNews Follow for more global Web3 & DeFi updates!
Crypto Companies Sponsor Trump's Inauguration
🔵 The inauguration will take place on January 20 at 20:00 MSK. Sponsor list includes ONDO, SOL, SUI, Coinbase, MetaMask, Gemini, and Galaxy.
🔥 The crypto industry strengthens its political position.
🧑⚖️ In other news, the SEC has filed a lawsuit against Nova Labs, the company behind Helium Network, for offering unregistered investment products linked to its cryptocurrency mining devices and user data exchange program.
Links:Crypto Twitter, News
#Crypto#Trump#SEC#Helium#NovaLabs#Solana#Coinbase#MetaMask#Gemini#Galaxy#ONDO#SUI#Dogecoin#DigitalAssets#CryptoPolitics#Cryptocurrency#News#Inauguration#Investment#Market
🚀 Tether-Linked PAC Makes Initial Expenditure Ahead of 2026 U.S. Midterm Elections
A political action committee associated with Tether, Fellowship PAC, has made its first expenditure ahead of the 2026 U.S. Congressional midterm elections. According to Odaily, the PAC paid approximately $300,000 to Nxum Group, a company co-founded by Bo Hines, to provide advertising services for Republican candidates.
Bo Hines currently serves as the head of Tether's U.S. operations and previously worked as a digital asset policy advisor in U.S. President Donald Trump's administration. Jesse Spiro, the chairman of Fellowship PAC, is also affiliated with Tether US.
Public records indicate that Nxum Group was established by Bo Hines and his partners. This transaction coincides with the PAC's initial expenditure report submission to the U.S. Federal Election Commission (FEC). Although Fellowship PAC has announced plans to invest up to $100 million in support of crypto-friendly candidates, its current account disclosures show nearly zero funds.
Under U.S. campaign finance regulations, political committees can pay affiliated entities for services, provided they adhere to the "fair market price" principle. This has sparked discussions about potential conflicts of interest.
Fellowship PAC has begun targeted advertising and candidate support in Republican elections, positioning itself as a new political influence tool for the crypto industry in the 2026 election cycle. However, questions remain regarding the transparency of its funding sources and operations.
#Tether#FellowshipPAC#2026Midterms#USPolitics#CampaignFinance#CryptoPolitics#BoHines#RepublicanCandidates#PoliticalActionCommittee#ElectionAdvertising#CryptoInfluence#FEC#PoliticalFunding#ConflictOfInterest#NxumGroup