В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль QtCompat (compatibility). Там не так много функций но они довольно полезны.
Этот модуль содержит унификаци модуля shiboken2, функций loadUi, translate и несколько переименованных функций классов или изменённую сигнатуру аргументов и возвращаемых значений. Это единственное исключение из правила когда вам потребуется где-то изменить свой код кроме импортов и этот код не похож на обычный код PySide2.
Например, в PyQt4 и PySide есть метод
QHeaderView.setResizeMode
Для PyQt5 и PySide2 они были благополучно переименованы в
QHeaderView.setSectionResizeMode
Чтобы применить этот метод следует использовать такой код
from Qt import QtCompath
header = self.horizontalHeader()
QtCompat.QHeaderView.setSectionResizeMode(header, QtWidgets.QHeaderView.Fixed)
Унификация загрузки UI файлов:
# PySide2
from PySide2.QtUiTools import QUiLoader
loader = QUiLoader()
widget = loader.load(ui_file)
# PyQt5
from PyQt5 import uic
widget = uic.loadUi(ui_file)
# Qt.py
from Qt import QtCompat
widget = QtCompat.loadUi(ui_file)
Хорошо что таких моментов не много и их легко запомнить.
Полный список можно посмотреть в таблице.
#qt#tricks
📣 Open Call: Entertainment & Creative Economy Startups!
Plug and Play Central Asia & IT Park Uzbekistan are launching Batch 6! We are looking for global innovators ready to scale.
We are seeking solutions in:
🎮 GameDev
👓 Immersive Tech (AR/VR, Metaverse 2.0, Content Monetization & Video Editing)
✈️ Travel & Tourism
Why join?
✨ Potential investment from IT Park Ventures
✨ Access to Silicon Valley via our GOAL Program
✨ Expert mentorship & global corporate network
✨ Pitch at the Batch 6 Expo in May 2026
📅 Deadline: January 15, 2026
🔗Apply here: https://www.plugandplaytechcenter.com/locations/uzbekistan
Let’s build the future together! 🚀
#PlugAndPlayCA#Startups#CreativeEconomy#GameDev#TravelTech#Uzbekistan
📣 Open Call: Enterprise & AI Startups — Your Moment Is Now!
🚀 Plug and Play Central Asia, in partnership with IT Park Uzbekistan, is on the lookout for high-potential startups from Central Asia and around the globe to join Batch 5 of Plug and Play Tech Center Accelerator Program in Uzbekistan.
Who should apply?
✔️ International startups ready to expand into Central Asia and establish a footprint in Uzbekistan
✔️ Homegrown Uzbekistan-based startups looking to scale fast with world-class support
✔️ High-growth startups with real traction and global ambition
What’s in it for you?
✔️ Expert mentorship and hands-on support from Plug and Play's global network
✔️ Investment opportunities and warm intros to VCs
✔️ Exclusive access to pitch at our Expo in front of corporates and investors
✔️ Practical workshops and pitch training sessions
✔️ The chance to join Plug and Play Tech Center GOAL Program in Silicon Valley and visit other locations
IT Park Ventures will review all participating startups for investment - supporting international startups considering entering Uzbekistan and helping local founders scale worldwide.
Applications are open here:link
🗓 Deadline to apply: July 15, 2025
🟢 Selected startups will be announced in August. The program kicks off in early October.
Apply now and let’s build the future together!
#PNPTC#PlugAndPlayCA#Uzbekistan#Accelerator#Batch5#OpenCall#ITPark
📣 Open Call: Enterprise & AI Startups — Your Moment Is Now!
🚀 Plug and Play Central Asia, in partnership with IT Park Uzbekistan, is on the lookout for high-potential startups from Central Asia and around the globe to join Batch 5 of Plug and Play Tech Center Accelerator Program in Uzbekistan.
Who should apply?
✔️ International startups ready to expand into Central Asia and establish a footprint in Uzbekistan
✔️ Homegrown Uzbekistan-based startups looking to scale fast with world-class support
✔️ High-growth startups with real traction and global ambition
What’s in it for you?
✔️ Expert mentorship and hands-on support from Plug and Play's global network
✔️ Investment opportunities and warm intros to VCs
✔️ Exclusive access to pitch at our Expo in front of corporates and investors
✔️ Practical workshops and pitch training sessions
✔️ The chance to join Plug and Play Tech Center GOAL Program in Silicon Valley and visit other locations
IT Park Ventures will review all participating startups for investment - supporting international startups considering entering Uzbekistan and helping local founders scale worldwide.
Applications are open here:link
🗓 Deadline to apply: July 15, 2025
🟢 Selected startups will be announced in August. The program kicks off in early October.
Apply now and let’s build the future together!
#PNPTC#PlugAndPlayCA#Uzbekistan#Accelerator#Batch5#OpenCall#ITPark