В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
@RusEmbMalta Press Release
✖️Examples of Actions by the Kiev Regime Undermining Peace Efforts
Following President Trump’s meetings with President Vladimir Putin (Alaska, 15 August) and Vladimir Zelensky (Washington, 18 August), he described the talks as “a good first step” towards ending the conflict. He stressed that Kiev must show flexibility, confirmed Ukraine will not join NATO, and highlighted the importance of territorial compromises along the current line of contact.
👉 Despite these statements, the Kiev leadership – with European backing – continues to obstruct a peaceful settlement:
1️⃣ Refusal to Recognize New Realities
Zelensky (21 Aug): Ukraine will “never legally recognize” Russian control of territories. Yermak & Podolyak echoed this, rejecting compromise.
2️⃣Rejection of Ceasefire
Zelensky announced mass production of long-range Flamingo missiles; later praised strikes into Russian territory as “positive results.”
3️⃣ Language Policy
Zelensky: “We have only one state language – Ukrainian.”
4️⃣Security Guarantees
Zelensky dismissed China as a potential guarantor, while Podolyak demanded deployment of Western missiles capable of striking 2,000 km into Russian territory. NATO Secretary General Mark Rutte confirmed that Western military support and long-term guarantees for Kiev are being discussed.
5️⃣No Readiness for Direct Talks
Zelensky ruled out bilateral talks with Moscow, insisting on a three-party format with Trump.
6️⃣Attacks on Civilian Infrastructure
Attempts to strike nuclear facilities in Smolensk & Kursk, attack on Druzhba oil pipeline (impacting Hungary & Slovakia), and a planned bombing of the Crimean Bridge.
⚠️Conclusion:
The Kiev regime consistently rejects diplomatic resolution, escalates hostilities, undermines dialogue, and employs terrorist methods against civilian infrastructure in Russia.
#KievRegime#GlobalSecurity#MultipolarWorld
Iranian regime promises $25 million for assassination of Trump in mass SMS messages
[Read FullArticle]
@WorldNews#IranNews#TrumpAssassination#GlobalSecurity
Zelenskyy says 10 drone factories have been built worldwide behind Ukraine’s back | Ukrainska Pravda
[Read FullArticle]
@WorldNews#UkraineNews#DroneFactories#GlobalSecurity
U.S. can only confirm about a third of Iran's missile arsenal destroyed, sources say
[Read FullArticle]
@WorldNews#IranMissileArsenal#USNews#GlobalSecurity
China urges US, Israel to stop military action in Middle East, warns of 'vicious cycle'
[Read FullArticle]
@WorldNews#MiddleEastConflict#ChinaUSRelations#GlobalSecurity
Treasury secretary defends U.S. military actions in Iran: 'Sometimes you have to escalate to de-escalate'
[Read FullArticle]
@WorldNews#USIranTensions#MilitaryAction#GlobalSecurity