В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
News: #Tulu Kappi gold mine officially launched in West #Wollega Zone
The gold development project at Tulu Kappi, located in Ganji district of West Wollega, has officially begun operations. On 18 February 2026, Prime Minister Abiy Ahmed, alongside Oromia Regional President Shimallis Abdisa, government officials, and project leaders, inaugurated the construction and development work of the site.
The project site lies 28 km east of Ayra town and covers approximately eight square kilometers. The project is led by KEFI Minerals, which acquired the site in 2014 from Nyota Minerals, previously engaged in exploration activities.
Prior to the official launch, KEFI held consultations with local communities and government officials to agree on resettlement plans and work arrangements.
https://addisstandard.com/?p=55257
Enat Party Alleges Government Forces Massacring Civilians In East Wollega. Read more. https://borkena.com/2025/12/12/enat-party-alleges-government-forces-massacring-civilians-in-east-wollega/#Ethiopia#humanrights#wollega#EnatParty
Reported Drone Strike in Wollega, Oromia region of Ethiopia. Read more.
https://borkena.com/2026/04/17/ethiopia-reported-drone-strike-in-wollega-oromia-region/#Ethiopia#News#Wollega#Dronestrike#humanrights
#GPE_EarlyWarning
April 24, 2026
Urgent Information: #Wollega‼️
Specific areas: #EastWollega Zone, #AngerGutin town
It has been five days since five district (woreda) leaders from areas in the East Wollega Zone with significant Amhara populations began a closed-door meeting in Anger Gutin town, alongside high-ranking officials from the regional level.
Our sources have confirmed that an agreement has been reached to launch a large-scale attack against the Amhara people. Therefore, we urge the entire population to take all necessary precautions and preparations.
___________________
For more updates follow us on:
➡️ Facebook: https://facebook.com/gpethiopia
➡️ X: https://X.com/gpethiopia
➡️ Instagram: https://instagram.com/gpethiopia
➡️ TikTok: https://www.tiktok.com/@gpethiopia
➡️ Telegram: https://t.me/gpe_central
➡️ WhatsAPP: https://whatsapp.com/channel/0029VaAazxGBFLgaX9umXK2M
➡️ Medium: https://gpethiopia.medium.com/