В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
Thousands flee #Akobo after #South_Sudan army issues forced evacuation order
Thousands of civilians have fled an opposition stronghold in eastern South Sudan after the army ordered evacuations to clear the way for a military offensive, the latest sign that the country’s fragile peace is unravelling, as fears of a return to all-out civil war haunt the world’s youngest nation.
The town of Akobo, near the #Ethiopian border, was almost completely emptied by Sunday after the South Sudan People’s Defense Forces issued an ultimatum on Friday demanding that civilians, aid workers and United Nations peacekeepers leave ahead of a planned assault.
“The town is now almost empty,” said Nhial Lew, a local humanitarian official. “Women, children and the elderly have left and crossed into Ethiopia.” By Sunday evening, he could hear the conflict closing in. “We are hearing the sound of machine guns....
https://www.aljazeera.com/amp/news/2026/3/8/thousands-flee-akobo-after-south-sudan-army-issues-forced-evacuation-order
100,000 flee #South_Sudan offensive into #Ethiopia: #UNICEF
An order by South Sudan's army to evacuate the opposition-held town of #Akobo earlier this month pushed an estimated 100,000 people to flee across the border into Ethiopia, UNICEF said Tuesday.
Akobo in the eastern state of Jonglei is the latest flashpoint as fighting between the government and opposition has brought South Sudan back to the brink of all-out civil war. The army ordered an evacuation of the town, including foreign aid agencies, on March 6.
It claims to have since taken control of Akobo, though there have been conflicting reports of events on the ground, which have been impossible to verify due to limited communications.
A security source told AFP that the army had taken over the military barracks in Akobo & destroyed buildings in the vicinity to create a buffer zone, but no official report had yet been issued....
https://www.facebook.com/AddisstandardEng/posts/pfbid0UmiC7pyEye84FEktt3LwgfgMHiF2MFVjvnVcxkEguK724EysYDK2P7hXgDrMXpFpl
#South_Sudan: “People keep asking me, is help coming?”
Last month, a grandmother, walked for seven days, carrying her month-and-a-few-days-old granddaughter, Nyabhan. Nyaphan Nyang, the grandmother, walked with a sense of urgency, surviving on leaves. She was fleeing from the conflict that had consumed #Walgak#Payam in #Akobo West, #Jonglei State. Besides, the baby was critically ill because of severe malnutrition.
Hunger had become widespread as conflict resurged in Jonglei State in December 2025. Bhan’s father had been killed in the conflict, while her mother and siblings were kidnapped by armed youth. Nyaphan was the baby’s only hope.
She did get her to safety and help. Unfortunately, it was too late. A few days later Nyabhan died.
The baby and the grandmother were among the several displaced people who met with Under-Secretary-General for Humanitarian Affairs and Emergency Relief Coordinator (ERC), Tom Fletcher, about a .....
https://www.unocha.org/news/south-sudan-people-keep-asking-me-help-coming