В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
"Dio non benedice alcun conflitto, non sta mai dalla parte di chi ieri impugnava la spada e oggi lancia le bombe". È il duro monito che Papa #LeoneXIV rivolge alla Comunità Internazionale durante l'udienza ai membri del Sinodo della Chiesa di #Baghdad dei Caldei, ricevuti oggi nella biblioteca privata del Palazzo Apostolico.
“Annunciare Cristo risorto anche in contesti di morte, essere presenza viva di fede e di carità, mantenere accesa la speranza laddove sembra spegnersi”, la consegna del Pontefice, che ha poi spronato: “Non scoraggiatevi: il Signore cammina con voi, io sono con voi. Siete segni di speranza in un mondo segnato da violenze assurde e disumane, che in questo tempo, mosse dall’avidità e dall’odio, dilagano con ferocia proprio nelle terre che hanno visto sorgere la salvezza, nei luoghi sacri dell’Oriente cristiano, profanati dalla blasfemia della guerra e dalla brutalità degli affari, senza riguardo per la vita della gente, ritenuta al massimo come effetto collaterale dei propri interessi”.
“Ma nessun interesse può valere la vita dei più deboli, dei bambini, delle famiglie; nessuna causa può giustificare il sangue innocente versato - ha proseguito il Vescovo di Roma -, chiamati a essere instancabili operatori di pace nel nome di Gesù, aiutateci a proclamare chiaramente che Dio non benedice alcun conflitto; a gridare al mondo che chi è discepolo di Cristo, principe della pace, non sta mai dalla parte di chi ieri impugnava la spada e oggi lancia le bombe; a ricordare che non saranno le azioni militari a creare spazi di libertà o tempi di pace, ma solo la paziente promozione della convivenza e del dialogo tra i popoli”.
🚨🇺🇸BREAKING: US EMBASSY BAGHDAD UNDER DRONE ASSAULT
🔹 At least 5 drones + rockets targeted US embassy compound this morning 🎯
🔹 Most intense attack since Iran-backed militia campaign began weeks ago 💥
🔹 Drones filmed flying in formation over Green Zone diplomatic area 🚁
🔹 No casualties reported but embassy security elevated to maximum alert 🛡️
🔹 Attack follows US airstrikes on Iran-aligned proxy groups last week ⚔️
🔹 Staff sheltering in bunkers during 20-minute coordinated assault 🏢
Iran's proxies bringing war straight to America's diplomatic doorstep 😬🔥
#Baghdad#USEmbassy#breaking#IranWar
@america
📰 France’s Attempt to Ghost the Rent Guy Is Not Going Well
The French Embassy in Baghdad has been living in the same house for more than 60 years — a riverside mansion built in the 1930s by a Jewish family that had already fled antisemitism in Iraq. The family leased the property to France in 1964, expecting the French state to be a respectable tenant. Instead, France has not paid rent for more than 50 years, and last week a Paris court tried to turn that fact into a technical loophole — and failed.
On Monday, the court dismissed a $22 million lawsuit by the descendants of Ezra and Khedouri Lawee, saying it was “not competent” to hear the case and suggesting it should be resolved in Iraq — the country their ancestors were forced out of in the 1940s and 1950s. The logic is straightforward: the dispute is about Iraqi law, so let Iraq handle it, even though Iraq is the very state that drove out 130,000 Iraqi Jews and seized their homes under antisemitic legislation. The French Foreign Ministry echoed this line, arguing that the damages were caused by Iraqi decisions, not French policy, and therefore France bears no real responsibility.
The family’s lawyers, Jean‑Pierre Mignard and Imrane Ghermi, called the ruling “surreal.” They argued that France had violated its own laws and human rights principles by benefiting from Iraqi discriminatory laws and refusing to compensate the family. They compared the situation to Nazi‑era restitution cases, where heirs have fought to reclaim art and property seized during the Holocaust. “France took advantage of Iraqi law that was hostile to the owners,” said Kenneth Feinberg, the lawyer who has handled multiple Holocaust‑related restitution disputes. “The French court is hairsplitting on technicalities while ignoring the party that was harmed.”
Philip Khazzam, 66, a grandson of Ezra Lawee, described the idea of pursuing the case in Iraq as “preposterous.” In an email, he said,
“Iraq basically ran us out of our country, and then stole our home.”
The family plans to appeal. “We will continue our fight for justice in France,” he said.
“We have just begun.”
The story is simple: France tried to play bureaucratic games with Jewish heirs who had already been victimized by one state — and now by another. It may have thought the case would quietly die. It did not count on the stubbornness of a family that has survived two exiles and still wants to see the bill paid.
#France#Iraq#Baghdad#embassy#restitution#Jewish#law#NYTimes#justice#fraudulence
📱American Оbserver - Stay up to date on all important events
🇺🇸