В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
India GST collections hit ₹2.43T in Apr’26 vs ₹2.23T (ex-cess) last year, +8.7% YoY; net GST ₹2.11T, +7.3%. Import-linked GST up 25.8%. Despite tax cuts, higher taxable value signals consumption strength; FY27 Centre target ₹10.2T.
#Economy
Centre to maintain FY27 capex at ₹12.22 lakh crore (+~9% YoY) vs ₹2 lakh crore in FY15. Govt to exit non-strategic sectors to crowd in private investment; LPG imports at ~60% with ~90% via Hormuz flagged as risk. R&D spend at 0.6% of GDP under review. #Economy
🇮🇳🤝🇨🇳 India gives fast track nod for China FDI in seven sectors
“These are capital goods, electronic capital goods, electronic components, polysilicon and ingot wafer, advanced battery components, rare earth permanent magnets, and rare earth processing”
#Economy
https://t.co/w0FYHf2dWh
Invest India brings in $6.1 bn investments across 60 projects in FY26 and It is estimated that India will attract investment worth $90 billion this year.
#Economy
Reliance Industries just posted ₹95,754 crore in annual profit. That is over $10 billion. First Indian company in history to cross that line.
The $10 billion profit club globally has maybe 50 companies. India just put one in it. #Economy
According to April 2026 IMF data, India has slipped to the 6th largest economy, falling behind the UK ($4.26T) with a projected FY27 nominal GDP of $4.15 trillion.
The decline is not due to a reduction in real economic growth, but primarily caused by a weakening Indian Rupee against the US Dollar and a downward revision of nominal GDP following a base-year change in Feb 2026.
#Economy