В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
News: More than eight million #Sudanese children miss nearly 500 days of schooling as war drags on
More than eight million children across Sudan have been deprived of education for nearly 500 days due to the ongoing war between the Sudanese Armed Forces and the Rapid Support Forces (#RSF), Save the Children warned on Wednesday.
The conflict, which erupted in April 2023, has triggered one of the longest school closures globally, surpassing even the prolonged shutdowns experienced during the COVID-19 pandemic.
According to the report, nearly half of Sudan’s estimated 17 million school-aged children have been unable to attend classes for about 484 days.
Save the Children said the education crisis has affected the entire country, with many schools remaining closed, others damaged by fighting, and some repurposed as shelters for families displaced by violence.
North Darfur has been among the hardest-hit regions, with only about three...
https://x.com/addisstandard/status/2014570940173066575?s=20
News: #Khartoum airport receives first scheduled flight since start of Sudan war
The international airport in Khartoum has received its first scheduled commercial flight in more than two years as the #Sudanese government continues to assert its control over Sudan’s capital city after years of fighting.
The Sudan Airways flight travelled to Khartoum from the Red Sea city of Port Sudan on Sunday, carrying dozens of passengers.
Reporting from near the runway where the flight had landed, Al Jazeera’s Taher Almardi described scenes of jubilation following the arrival of the plane.
He said the reopening of the airport will help connect the capital to other regions in Sudan, with officials saying the facility is now ready to welcome as many as four flights daily.
Sudan Airways said in a statement that the flight, which was announced on Saturday with ticket prices starting at $50, ....
https://web.facebook.com/AddisstandardEng/posts/pfbid021sHpU1gGTz2SZF2qejYi6G1D3siDnLwXXK2hcCEsiHW1Qb8ADaaB8tGA4kq2MvEZl
A #Sudanese doctor recounts his harrowing escape from a #Darfur city under rebel bombardment
Dr. Mohamed Ibrahim dashed from building to building, desperate for places to hide. He ran through streets littered with bodies. Around him, the capital of Sudan’s North Darfur province lay enveloped in smoke and fire.
Explosions, shelling and gunfire thundered from every direction.
After 18 months of battling, paramilitary fighters had overrun el-Fasher, the Sudanese army’s only remaining stronghold in the Darfur region. Ibrahim, who fled the city’s last functioning hospital with a colleague, said he feared he would not live to see the sun go down.
“All around we saw people running and falling to the ground in front of us,” the 28-year-old physician told The Associated Press, recounting the assault that began Oct. 26 and lasted three days. “We moved from house to house, from wall to wall under non-stop bombardment.....
https://apnews.com/article/sudan-elfasher-rsf-war-darfur-f91bfe006211fbf3af21b12271710eed
News: #Sudanese refugees in #Ethiopia face growing hardship amid funding gaps, administrative barriers
Thousands of Sudanese refugees sheltering in Ethiopia are facing worsening humanitarian conditions marked by food shortages, overcrowded camps, and administrative challenges, according to reports by Sudan Tribune.
Ethiopia, which hosts a significant number of refugees fleeing the conflict in Sudan, is struggling to sustain humanitarian assistance as international funding declines. Refugees in camps across western Ethiopia, particularly in #Benishangul-Gumuz Region, told the media that food rations have been sharply reduced, leaving many households unable to meet basic nutritional needs.
Aid agencies have warned that funding shortfalls have forced cuts to food assistance, with refugees receiving rations well below minimum caloric requirements. As a result, families are reportedly skipping meals, selling personal belongings, and resorting to other negative...
Read more: https://addisstandard.com/?p=54660
#Sudanese army says it repelled rebel attack in #Blue_Nile region
The Sudanese army said on Tuesday it repelled a fresh attack by the Rapid Support Forces (#RSF) and the Sudan People’s Liberation Movement-North (SPLM-N) led by Abdel Aziz al-Hilu in the Blue Nile region.
Military operations in the southeastern region have escalated since March, following a large-scale offensive by the RSF and its ally that resulted in the capture of the strategic border town of Kurmuk and surrounding areas.
The army’s 4th Infantry Division said in a statement that its forces, supported by allied groups, “defeated the terrorist militia on the outskirts of the Sali area along the southern axis.”
The military reported significant losses among the attacking forces, claiming to have seized 10 combat vehicles in good condition and destroyed more than 15 others.
https://sudantribune.com/article/313273
War pushes seven in 10 #Sudanese into poverty: #UN official
Around seven in 10 people in Sudan are now living in poverty, a senior UN official told AFP on Tuesday, nearly twice as many as before the war between the army and paramilitary forces broke out three years ago.
"Before the war, we were probably looking (at) around 38 percent of people living in poverty, and now we are estimating about 70 percent," said the UN Development Programme's Sudan representative Luca Renda, as the agency released a new report on poverty timed to coincide with the anniversary of the start of the war.
The figures Renda cited were based on a poverty line of about $4 a day, while at least a quarter of the population is believed to be surviving on less than half that, he said.
Conditions are particularly severe in some of the worst-affected areas, including parts of southern #Kordofan, now the war's.......
https://www.facebook.com/AddisstandardEng/posts/pfbid02PFCAM1K5AbE7Yyd9DhpKeaUqinzU6Bpzp2ZAfQWNQy7iMeXnS5d3hja41VwctUb7l
#Sudanese gov't returns to #Khartoum after nearly 3 years of war
Sudanese Prime Minister Kamil Idris on Sunday announced the return of the government to the capital, Khartoum, for the first time since the outbreak of war on April 15, 2023, after nearly three years of running state affairs from the eastern city of #Port_Sudan.
"The government has returned to the national capital," Idris said in a speech to a crowd following his arrival in Bahri, north of Khartoum.
He pledged to improve basic services, particularly in the health and education sectors, and to rebuild hospitals and rehabilitate schools and universities, foremost among them the University of Khartoum.
The prime minister added that 2026 would be "the year of peace in Sudan," pointing to plans for reconstruction and development, as well as efforts to improve the economic situation by increasing gross national product, reducing inflation, and stabilizing the exchange ....
https://english.news.cn/20260111/57d8cfd50a314aa4bcd1e90564c45698/c.html
News: Human Rights Watch accuses #Sudanese army, allies of arbitrary detention, torture
Human Rights Watch (#HRW) has accused forces affiliated with the Sudanese Armed Forces (#SAF) of carrying out widespread arbitrary detentions, torture, and ill-treatment of civilians in areas under their control.
In a report released Tuesday, HRW said civilians were targeted on allegations of collaborating with the Rapid Support Forces (#RSF), often based on ethnicity, perceived political affiliation, or humanitarian work.
The organization warned that such abuses, including unlawful detention and torture, may amount to war crimes and crimes against humanity.
The report, based on interviews with 28 individuals conducted between June 2025 and February 2026, documents cases of incommunicado detention, enforced disappearances, and deaths in custody.
Former detainees and witnesses described.........
https://www.facebook.com/AddisstandardEng/posts/pfbid023d7PDtTn4vknNgegTfntDVzs5Ctw9tn2jvHVs81npRew6gBad4nbaH9dh6JKUhnzl
#Burhan: Military operations will continue until rebellion’s defeat
The Chairman of the Transitional Sovereign Council and Commander-in-Chief of the #Sudanese Armed Forces (#SAF), Lieutenant General Abdel Fattah al-Burhan, met on Sunday with Musa Hilal, head of the Revolutionary Awakening Council, in the presence of the Governor of Darfur, Minni Arko Minawi.
During the meeting, the Chairman of the Sovereign Council offered his condolences for the martyrs of Mustariha region who confronted the militia’s aggression and sacrificed their souls for the nation’s honor and dignity.
The meeting also addressed the situation in North Darfur State and the violations committed by the #RSF against civilians in the Mustariha region.
Burhan affirmed that SAF Forces are continuing their operations until the rebellion is eradicated and security and stability are restored all over the country......
https://sudanhorizon.com/burhan-military-operations-will-continue-until-rebellions-defeat/
News: #Sudan criticizes Berlin conference as ‘colonial tutelage,’ rejects exclusion of Khartoum
Addis Abeba — Sudan has denounced a conference held in #Berlin, #Germany, criticizing it as a “colonial tutelage approach” and accusing Western countries of attempting to impose their agenda without consulting Khartoum.
In a statement issued on Wednesday, Sudan’s Foreign Ministry said organizing the conference without coordination with the Sudanese government reflects “disregard for the visions presented by the #Sudanese state and its official institutions.”
The conference, held in Berlin, brought together Sudanese political and civilian groups and aims to mobilize support for people affected by the ongoing war, as well as explore pathways toward ending the conflict between the Sudanese army and the paramilitary Rapid Support Forces (#RSF).
Khartoum said the move “reflects a colonial tutelage approach still practiced by some
Read more: https://www.facebook.com/share/p/1ArmnNZVd5/?mibextid=wwXIfr
News: #Sudanese army says RSF vehicles destroyed in Blue Nile Region near #Ethiopian border
Mekelle - The Sudanese Armed Forces (#SAF) said on Monday that their troops had destroyed several Rapid Support Forces (#RSF) vehicles in the #Blue_Nile sector, a region neighboring Ethiopia, during military operations carried out over the past 72 hours, as fighting continues across multiple fronts in the country.
In a statement issued by the SAF General Command, the army said four military vehicles belonging to the RSF were destroyed in the Blue Nile area, with dozens of RSF fighters killed or wounded during the operations.
The sector lies along Sudan’s southeastern corridor, near the Ethiopian border.
According to the SAF, operations in the Kordofan sector resulted in the destruction of 56 military vehicles and significant casualties among RSF fighters, while a further 47 vehicles were destroyed in the Darfur sector.....
Read more: https://addisstandard.com/?p=54548
#US blacklists #Sudanese Muslim Brotherhood as ‘terrorist’ group
The United States has designated the Sudanese #Muslim_Brotherhood as a “terrorist” group, as the administration of President Donald Trump widens its crackdown on the organisation.
The State Department accused the Sudanese Muslim Brotherhood on Monday of receiving support from Iran’s Islamic Revolutionary Guard Corps (#IRGC).
Washington labelled the group as a “specially designated global terrorist” (#SDGT) and said that it will designate it as a “foreign terrorist organisation” (FTO) starting next week.
“The Sudanese Muslim Brotherhood uses unrestrained violence against civilians to undermine efforts to ........
https://www.aljazeera.com/news/2026/3/9/us-blacklists-sudanese-muslim-brotherhood-as-terrorist-group?utm