Для тех кто пишет расширения на 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
Navigate the right GST rate to pay for transactions spanning the rate change with new mummy and her bestie! 💁♀️💡
A transaction is considered to span the GST rate change if one or two of the following events takes place wholly or partially on/after 1 Jan 2024:
- The issuance of invoice by supplier
- The receipt of payment by supplier
- The delivery of goods or performance of services
More info at go.gov.sg/irasgst-rc-consumers
#GST#GSTRateChange#skit#iras#irassg
Know an Asian mum (or dad) who needs help with tax filing? Share this video with them! 👩🏻👨🏻
Follow us on TikTok: www.tiktok.com/@irassg
#taxseason2024#taxtips#pov#skit#asianmums#iras#irassg
Is delulu the solulu? At least, she gained some tax tips on Supplementary Retirement Scheme (SRS) contributions! 💰🤣
Grow your savings by contributing to your SRS Account today! You will be eligible for tax reliefs in Year of Assessment 2024 if you make contribution to your SRS Account by 31 Dec 2023*.
SRS contributions are capped yearly at $15,300 for Singapore Citizens and Permanent Residents and $35,700 for foreigners.
Do note that there is an overall cap of $80,000 on the total amount of all tax reliefs that can be claimed (including any relief on SRS contributions) for a year.
Details and qualifying conditions:
https://www.iras.gov.sg/taxes/individual-income-tax/basics-of-individual-income-tax/special-tax-schemes/srs-contributions
*You are advised to check with your SRS bank operator about the cut-off date for SRS contributions.
#taxtips#retirement#invest#skit#girlsvsguys#irassg#iras
Spread some year-end cheer while saving on your taxes! 🥳✨
Enjoy tax deductions of 2.5 times the qualifying donation amount in Year of Assessment 2024 when you donate to any approved Institution of a Public Character (IPC) by 31 Dec 2023.
You will not need to declare the donation amount in your Income Tax Return as tax deductions for qualifying donations will be automatically reflected in your tax assessments based on information from the IPC.
Details and qualifying conditions:
https://www.iras.gov.sg/taxes/other-taxes/charities/donations-tax-deductions
#taxtips#donations#spreadjoy#seasonsgreetings#skit#irassg#iras
Bracing for the annual CNY “kaypoh” questions too? 😅 Here’s one thing less to worry about – use the Personal Relief Checker (go.gov.sg/personalreliefchecker) to discover the personal tax reliefs you're eligible for in the upcoming tax season! 🔍
#pov#skit#cny2024#asianrelatives#taxreliefs#taxtips#irassg
Yasss to being a financially savvy kween! 🙌👑 It’s never too soon to secure the bag for your (and your fam’s) retirement 🌟
Top up your own and/or those of your family members’ CPF Special/Retirement or Medisave Account by 31 Dec 2023 to enjoy the CPF Cash Top-up Relief in Year of Assessment 2024.
Do note that there is an overall cap of $80,000 on the total amount of all tax reliefs that can be claimed (including any relief on CPF Cash Top-ups) for a year.
Details and qualifying conditions:
https://www.iras.gov.sg/taxes/individual-income-tax/basics-of-individual-income-tax/tax-reliefs-rebates-and-deductions/tax-reliefs/central-provident-fund-(cpf)-cash-top-up-relief
#taxtips#retirement#cpf#skit#asianmums#giftideas#irassg#iras
Delivery workers, we’re not gatekeeping this piece of good news! 🤩 Head over to go.gov.sg/iras-fedr-seps to find out more!
#taxseason2024#taxtips#pov#skit#bro#gatekeep#iras#irassg#deliveryheroes