Для тех кто пишет расширения на 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
🇮🇷 Breaking: University protests flare up across Iran
New student protests erupted at major Iranian universities as the new term began, with demonstrators honouring victims of last month’s deadly crackdown. Clashes were reported in Tehran, with chants targeting Supreme Leader Ali Khamenei and reviving the “Woman, Life, Freedom” movement.
The unrest comes amid rising geopolitical tensions, as the U.S. boosts its regional military presence while nuclear talks with Tehran remain unresolved. #News#Iran#University
「💻」#university#studying_tips
new semester, better me 📚🦪.
Yesterday I did a lot of stuff including unpacking and setting up my room for the semester.
Of course I will redecorate it, however I shouldn’t forget that this room is for only one semester
✨
Inshallah will go to study away
😻
~🐈~
↬@jastm1🌊
「💻」#university#studying_tips
❤️Some college x School inspo
✨A new chapter is here!✨
Are you ready for school/college? ✨
This is the perfect time to set new ambitions and new goals. A chance to start fresh, grow, and chase the best version of yourself. 🌱
Don’t be shy, step forward with confidence, give it your best, and make this year unforgettable.💗🫶
~🐈~
↬@jastm1🌊
「💻」#university#studying_tips
Checklist of things to pack for UNIVERSITY🥳!
Most of you might be overwhelmed with the amount of things to do, but don't worry you've got this 💪.
Save not to loose!
~🐈~
↬@jastm1🌊
https://www.coursera.org/specializations/data-science-python?utm_medium=email&utm_source=marketing&utm_campaign=2QBGEJZREeajEnVsu251ig
The 5 courses in this #University of #Michigan specialization introduce learners to data science through the python programming language. This skills-based specialization is intended for learners who have basic a python or programming background, and want to apply statistical, machine learning, information visualization, and text analysis techniques to gain new insight into their data.
Introduction to Data Science with Python (course 1), Applied Plotting, Charting & Data Representation in Python (course 2), and Applied Machine Learning in Python (course 3) should be taken in order and prior to any other course in the specialization. After completing those, courses 4 and 5 can be taken in any order. All 5 are required to earn a certificate.
Bizning faxriy oqituvchimiz Sultanov Ruslan Rustamovich
➖➖➖➖
Наш почётный учитель Султанов Руслан Рустамович
#tiue#university#университет
Telegram | Instagram | Website
Congratulations Class of 2027! Welcome to New Uzbekistan University! 🎉
#NewUU2027#NewUzbekistanUniversity#University
Check out the full video on our YouTube!
Best Regards,
NewUU Student Council
Telegarm | Instagram
🇰🇷Janubiy Koreya ta’lim tashkilotlari bilan hamkorlik aloqalari mustahkamlanmoqda
🇺🇿Batafsil
___
Strengthening cooperation with South Korean educational organizations
🇬🇧Eng
___
Укрепление сотрудничества с Южно-Корейскими образовательными организациями
🇷🇺Ru
#GraduateSchool#Soonchunhyang#University#Cooperation
Web-site | Telegram | Facebook | Instagram
Handong Global universiteti bilan hamkorlikni yangi bosqichlari
🇺🇿Batafsil
___
New Stages of Collaboration with Handong Global University
🇬🇧Eng
___
Новые этапы сотрудничества с Глобальным университетом Хандонг
🇷🇺Ru
#GraduateSchool#Handong#Collaboration#University
Web-site | Telegram | Facebook | Instagram