В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
📍 Road from Surum to Tashaul
📅 Video recorded on February 26
The village of Surum (Sur-um) is located in Tashkent Region, bordering the Sergeli and Yangihayot districts of Tashkent (about 9 km from the center of Sergeli).
The video shows thick dust from operating crushers. According to local residents, this situation has been ongoing for a long time.
Residents complain about:
▪️ constant loud noise;
▪️ dense dust in the air;
▪️ difficulty breathing and worsening living conditions.
The community asks authorities to pay attention to the environmental situation and take measures to reduce dust and noise levels.
❗️ The situation requires inspection by responsible agencies and an assessment of its impact on the environment and public health.
#Environment#TashkentRegion#Dust#Noise#EnvironmentalIssue
☘️ Follow the latest environmental news on @ekologuz. Send your suggestions and feedback via @eklguz_bot!
Meeting with animal capture services of Tashkent region
Representatives of NGO «HAYOT», together with the Head of the Security Service of the Ministry of Internal Affairs of the Republic of Uzbekistan, Lieutenant Colonel Rovshan Pirimkulov, held a meeting with animal capture services from Yangiyul, Angren, Akhangaran, Buka, Pskent, Nurafshan, Bekabad, Urta Chirchik, Kibray, Bostanlyk, and Parkent.
Key conclusions:
✅ Animal capture activities must be carried out strictly within the law and in compliance with humane standards; cruel methods are unacceptable.
✅ Violations will receive legal assessment by competent authorities.
✅ Cat capture has been suspended — the “Mushukkent” project (sterilization and humane population control) continues.
✅ Issues related to salaries, equipment, and inventory for humane capture were discussed.
✅ Public awareness activities are planned, along with the possible allocation of land for state animal shelters.
💡 The meeting was held in a constructive dialogue format and may become a starting point for real changes in the field of animal welfare.
#NNOHAYOT#HumaneCapture#Mushukkent#TashkentRegion#AnimalProtection
☘️Read the latest environmental news on the @ekologuz page. Follow us and send your suggestions and wishes via @eklguz_bot
Instagram | Facebook | Twitter | Sayt | Youtube.
Uzbekistan has opened a criminal case against penitentiary system officers after a man previously convicted of pedophilia escaped from a colony and assaulted a third-grade girl in the Akhangaran district. The National Agency for Social Protection is overseeing the case.
https://yep.uz/en/2025/10/uzbekistan-investigates-police-actions-after-convicted-pedophile-escape/
#Uzbekistan#Akhangaran#TashkentRegion#InteriorMinistry#Investigation#SocialProtection#Law