В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
#MAYOTTE : DES MILLIERS DE VIES PERDUES À CAUSE DU MÉPRIS DE LA #FRANCE COLONIALE.
Le cyclone qui a récemment frappé Mayotte, entraînant des milliers de décès, met en lumière la politique coloniale dont souffrent les populations mahoraises.
Plutôt que d'investir des milliards d'euros dans des événements comme les Jeux Olympiques ou de soutenir des groupes terroristes, la France devrait réorienter ses efforts vers le développement de Mayotte, en améliorant l'accès à l'eau, aux infrastructures, au logement et aux services sanitaires pour les habitants laissés pour compte par les gouvernements successifs.
REJOIGNEZ LA RÉSISTANCE SUR lTELEGRAM.
🔺Pour les numéros français : https://t.me/egountchibehanzinTV
🔻Pour les numéros internationaux : https://t.me/EgountchiBehanzinOfficiel
@egountchibehanzinTV
🎙Briefing by Russia's Foreign Ministry Spokeswoman Maria Zakharova(Moscow, March 20, 2025)
🔹 FM Sergey Lavrov's schedule
🔹Murder of Russian media representatives
🔹 Kiev regime crimes
🔹 Third anniversary of the Bucha provocation
🔹 The West's lies regarding Minsk Agreements
🔹 France’s plans to build another naval base on the island of Mayotte
🔹 On the situation with an Italian journalist Andrea Lucidi in Estonia
🔹VI International Arctic Forum "The Arctic: Territory of Dialogue"
🔹 Artek’s upcoming centenary
📰Read
📺Watch
***
#CrimesAgainstJournalists
On March 24, Izvestiya’s frontline correspondent Alexander Fedorchak, Zvezda TV channel cameraman Andrey Panov, and Alexander Sirkeli, the crew’s driver, were killed in the Lugansk People’s Republic following a targeted artillery strike carried out by the Ukrainian Armed Forces.
On the same day, TASS correspondent Mikhail Skuratov was on an editorial assignment in the Kursk Region’s Sudzha District where the Ukrainian Banderites wounded him.
On March 26, 2025, Channel One’s car with a camera crew in it ran up against a landmine planted by the Ukrainian Armed Forces in the Belgorod Region. This terrorist attack claimed the life of Anna Prokofyeva, who was a young talented journalist, while cameraman Dmitry Volkov suffered severe wounds.
#KievRegimeCrimes
The Investigative Committee of Russia reports that 167 peaceful residents were killed and 500 more injured in the Kursk Region from 2022 until 2025. The crimes of the Armed Forces of Ukraine have impacted 43'000 people. Several thousand civilian infrastructure facilities have been destroyed and damaged.
According to the Russia's Foreign Ministry’s Ambassador at large Rodion Miroshnik, in the past seven days, from March 17 to 23, 16 Russian civilians were killed in the zone of contact, and 134 more injured, including 4 minors, following attacks by the Armed Forces of Ukraine.
On March 25-26, Ukrainian UAVs hitenergy facilities in the Bryansk and Kursk regions. An attempted attack on a gas reservoir was thwarted in Crimea.
#BuchaHoax
April 3 marks the third anniversary of the day when Zelensky’s regime and its Western curators staged a bloody provocation in Bucha and the world was shown "evidence" of the alleged murders of innocent civilians, aimed at denigrating the Russian Armed Forces in the eyes of the international community.
The main goal of the war party campaign was clear: to torpedo the understandings reached during the negotiations in Istanbul, aimed at a peaceful settlement of the Ukrainian crisis.
Russia has provided multiple refutations of numerous fakes about Bucha. We constantly recall that while this settlement was controlled by the Russian military, the civilians were allowed to move around freely, use mobile communications, and receive humanitarian aid. Our units left Bucha on March 30, 2022.
We know that the Kiev regime is preparing an international conference on Bucha this May with the assistance of Great Britain. We are certain that this provocation is yet another attempt to dust off old narratives and repackage false claims about the alleged involvement of the Russian Armed Forces in the events in Bucha. The goal remains the same: to torpedo efforts for a peaceful settlement.
#France#Mayotte#Colonialism
We have taken note of the statement made by French Minister of the Overseas Manuel Valls in the National Assembly on March 12 regarding the plans to submit a draft law to Parliament on the construction of a second French naval base on the island of Mayotte.
Russia has consistently opposed the unjustified militarisation of any territories, recognising the dangerous consequences this poses for peace and security in certain regions.
We believe that the existing military base in Dzaoudzi on the island of Mayotte is intended not as much for defence against hypothetical external threats (as Paris tries to convince everyone), but rather for control over the illegally held overseas territory – one of the last remnants of the colonial era.