В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
#Yangiyul
Animals in the municipal veterinary service are dying without access to food and water
A situation causing serious concern among animal rights activists and the public has been reported in the city of Yangiyul. According to them, an institution that is supposed to provide care and treatment for animals has become the center of a scandal due to improper conditions in its quarantine facility.
Reports indicate that animals in the isolation unit are being kept without access to food and water. Of particular concern is an injured dog that urgently requires veterinary care. However, activists claim that no necessary treatment or care is being provided.
Elena Vladimirovna Babenko, a member of the Public Council under the National Committee on Ecology and Climate Change, contacted the Veterinary Committee’s hotline (71 202 12 00, ext. 201). She was informed that the situation would be reviewed and appropriate measures would be taken.
Despite these assurances, volunteers say that no changes have occurred on site. A volunteer named Asiya attempted to deliver medication, water, and food for the animals, but was denied access to the facility.
Animal rights activists insist on an urgent inspection by the relevant authorities and a legal assessment of the situation.
☘️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.
🚨 Lawlessness or rule of law? A zoo volunteer’s home attacked in Yangiyul
The conflict between animal rights defenders and the animal control service has escalated into open confrontation. According to volunteers, the situation has already gone beyond legal boundaries and is infringing on fundamental civil rights.
Animal welfare activists Asiya Abuzyárova and Svetlana Velichko reported that about 30 dogs disappeared from the territory of a municipal improvement enterprise. After attempts to return the animals, pressure reportedly began: a complaint was filed with the police, a volunteer was attacked, her phone was broken, and activists were allegedly harassed.
❗️ The most serious incident was the forced entry into a private home.
According to reports, municipal workers used a ladder to break a window and enter Asiya Abuzyárova’s house, forcibly removing the animals inside. When the homeowner resisted, her phone was destroyed and her hand was injured.
⚖️ According to the legislation of Uzbekistan:
🔹 The home is inviolable — entry without the residents’ consent is allowed only on legal grounds or by court order.
🔹 Private property is protected by the state — damage to property and unlawful seizure are prohibited.
🔹 Any actions by officials must have legal grounds and be properly documented.
This may constitute unlawful entry into a residence, abuse of authority, and violation of citizens’ rights.
📢 Key questions arise:
✔️ On what legal basis were the animals seized?
✔️ Who authorized the entry into the home?
✔️ Why are reports of property damage and injuries being ignored?
The law must apply equally to everyone — both citizens and officials. The situation requires a transparent investigation and a legal assessment of the actions of all parties.
#Yangiyul#civilrights#animalprotection#ruleoflaw
☘️ Follow the latest environmental news on @ekologuz. Send your suggestions and feedback via @eklguz_bot
🐾 Where are the dogs disappearing in Yangiyul?
At the temporary dog holding center (shelter) in Yangiyul, on February 10, volunteers recorded the dogs in the shelter. According to the volunteers, almost no adult dogs remained — all of them were reportedly killed overnight.
A day earlier, many dogs were in the shelter, but when the volunteers visited, they saw only 5–6 dogs in the cages. The question is: where did the rest of the dogs go? Volunteers say they were killed.
According to the volunteers, tomorrow the remaining poor dogs on Persidskaya Street — who are already afraid of every little sound — are also scheduled to be killed.
💔 This is not just statistics. This is a matter of our humanity.
#ProtectAnimals#Yangiyul#AgainstCruelty#Ethics#Animals
☘️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