В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
#photo#SouthSudan
The world’s newest country, South Sudan, marked a decade of independence this month, but it’s still one of the world’s poorest nations, scarred by war and hunger.
South Sudan gained independence in 2011, but an intertribal conflict broke out two years later that escalated into a full-blown civil war which has crippled the country’s economy and agriculture.
This Red Cross station in Kobok was the only place where people in South Sudan’s Upper Nile region could get medical help, make phone calls, or simply get something to eat. The Red Cross staff treated all patients equally, regardless of whether they were soldiers or civilians.
Unfortunately, the hospital was destroyed by government forces three weeks after our crew filmed it.
Follow: https://t.me/rtdocumentary
🇨🇳#China - 🇸🇸#SouthSudan: Chinese troops from the 12th Chinese Peacekeeping Infantry Battalion under UNMISS (UN mission in South Sudan) conducted live-fire training in South Sudan last week.
UNMISS has been in the country since 2011 to protect civilians and support stability. The Chinese contingent previously drew major attention after the July 2016 Juba violence, when internal UN findings said Chinese and Ethiopian peacekeepers did not leave their bases to assist civilians despite orders to intervene.
An aid workers’ compound only a few hundred meters from a UN base received no help despite repeated distress calls and a survivor personally reaching the base and pleading for help. Multiple civilians, as well as a journalist, were killed during the clashes at that time.
🇷🇺🇸🇸 The Ambassador of Russia to South Sudan, A.Kosmodemiyanskiy, met with the Minister of Presidential Affairs of South Sudan, Africano Mande Gedima.
🔸 During the friendly and constructive discussion, current issues of bilateral relations were addressed.
🔸A.Kosmodemiyanskiy handed over to the Minister a copy of the personal invitationfrom the President of the Russian Federation, Vladimir Putin, to the President of South Sudan, Salva Kiir Mayardit, to attend the Third Russia-Africa Summit, which will take place in Moscow in October this year.
🔸 Following the meeting, the parties agreed to expand political, economic, and cultural cooperation between the two countries, as well as to arrange training in Russia for staffof the National Elections Commission of South Sudan in preparation for the upcoming presidential elections in December this year.
#Africa#Russia#SouthSudan
Ethiopia, South Sudan To Fast Track Implementing Agreements. Read more.
https://borkena.com/2026/04/26/ethiopia-south-sudan-to-fast-track-implementing-agreements/#Ethiopia#SouthSudan#SouthSudanNews#EthiopianNews#economicintegration#cooperation
Africa Cup of Nations - Qualification🌍
2026-03-29 13:00 UTC
South Sudan vs. Djibouti
Predicted outcome: South Sudan❌
Predicted score: 4:0
Actual: Djibouti 0:1
#SouthSudan#Djibouti
2026-03-29 15:00 UTC
Lesotho vs. Seychelles
Predicted outcome: Draw❌
Predicted score: 0:0
Actual: Lesotho 2:1
#Lesotho#Seychelles
#Football#AfricaCupofNations
Africa Cup of Nations - Qualification🌍
2026-03-26 13:00 UTC
Djibouti vs. South Sudan
Predicted outcome: South Sudan✅
Predicted score: 1:3
Actual: South Sudan 0:4
#Djibouti#SouthSudan
2026-03-26 14:00 UTC
Seychelles vs. Lesotho
Predicted outcome: Lesotho❌
Predicted score: 0:2
Actual: Draw 0:0
#Seychelles#Lesotho
#Football#AfricaCupofNations