Для тех кто пишет расширения на 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
🎙 INVEST REPORT Announce #FINEproject update
#FINE is Trending first in Dextool. Reaching out Millions of investors.
👉 Order dextool Trend starting with 6500$ per 24 hours
1️⃣ Dextool trending working
2️⃣ Big marketing Campaign incoming
3️⃣ Reached 30 mil mcap 🔜 50 Mil $ Mcap
We announced at 9 mil $ Mcap. We just hit 30mil $ mcap and we are getting closer to 100,000,000 Mcap.
At the moment we made for you 230% Profit
⚠️Always do your own research and due diligence when considering your participation in any blockchain project.
🎙 NEW GEM #FINE
I think here is big potential to grow, marketing incoming. 🆘Be careful, put small bag here.
Marketcap: 9.5 MIL $
Price now: 0.000000023618598849591634 $
1️⃣Dextool trending working, order Dextool Trending
2️⃣Big marketing Campaign incoming
✅ More information
Telegram: https://t.me/+YIevhi57q2phY2Y6
Website:https://www.finerc.vip/
👉 BUY HERE: https://www.dextools.io/app/en/ether/pair-explorer/0xb54ce26f2e30f64c5b684b141311ce138ab5e00e
🧨 Push cooperating with@Whales100xsignals
#MEMECOIN#GEM
The increase in fines for a number of traffic violations will come into force on January 1, 2025
📌"In Article 2, the word" Law "should be replaced with the words "Federal Law", the words "after thirty days from the date of its official publication" should be replaced with the words "from January 1, 2025," the text of the amendment posted in the Duma electronic database says.
📌Under this law, failure by a driver to perform the duty to insure his civil liability, as well as driving a vehicle, if the Compulsory third Party Insurance (CTP) policy is deliberately absent, entails the imposition of an administrative fine in the amount of 800 rubles.
📌Earlier, the Parliament of the Kabardino-Balkar Republic submitted to the State Duma a bill that proposes to establish a fine for repeated violation of the Administrative Code of the Russian Federation, namely the absence of a driver's CTP policy, up to 5 thousand rubles.
CTP policy means Compulsory Third Party Insurance Policy
#news#russia#nido_russia#traffic#fine#regulations
https://t.me/nido_russia