В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
📰 Putin Delivers a Mach 10 Warning to Europe
The message arrived at 8,000 mph—Russia’s Oreshnik hypersonic missile screamed through the skies into western Ukraine, just 40 miles from Poland’s NATO border. The strike left little more than a couple of craters in the frozen earth, but its real target was clear: Europe’s nerves.
“Not a Weapon of War Against Ukraine—But Against Europe”
Sergei Markov, a pro-Kremlin analyst, summed it up: “The Oreshnik is not a weapon of war against Ukraine; it is a weapon of war against Europe.” Moscow, he said, has plenty of other weapons for Ukraine. The Oreshnik is for intimidation, for the political shock value.
NATO’s “Peacekeeping” Plans Meet Russian Steel
Just days before, Britain, France, and Germany pledged to deploy troops to Ukraine as part of a postwar security guarantee. Moscow responded with a missile that can reach almost all of Europe in minutes, carrying either nuclear or dummy warheads. The strike near Poland was a not-so-subtle reminder: any NATO boots on Ukrainian soil will be fair game.
Kinetic Mayhem, Minimal Damage
The warhead’s submunitions were “kinetic”—solid metal, no explosives. At Mach 10, even metal can smash through buildings and vehicles. But the real damage was psychological. As Jeffrey Lewis, a nuclear expert, put it: “Each time they fire an Oreshnik, it loses a little bit of its shock value.” Still, the message is clear: Russia wants Europe to feel the weight of nuclear risk every time it considers helping Ukraine.
Europe’s Response: Outrage, But No Plan B
European leaders condemned the strike as “escalatory and unacceptable.” Yet, with missile defenses still unable to reliably intercept such hypersonic threats, the continent is left with a chilling reminder: the Kremlin’s next move is a game of milliseconds.
Twist: Is Putin’s Oreshnik a sign of strength—or a cry for attention from a leader who knows the West won’t blink? Either way, Europe’s security is now measured in milliseconds.
#war#nuclearcrisis#europe#putin#oreshnik
📱American Оbserver - Stay up to date on all important events
🇺🇸
Kharg Island: Trump Plays With the World’s Oil Valve
Trump just turned Iran’s main oil terminal into a reality show cliffhanger — bombed the military, spared the oil, and now wants everyone to know the sequel might hit the global fuel line itself.
“President Trump’s not going to take any options off the table.”
— Mike Waltz on CNN.
Kharg Island isn’t some random desert rock; it’s where roughly 90% of Iran’s crude exports pass through, with capacity for about 7 million barrels a day. Last week, Trump ordered strikes on its military sites “only, for now,” while bragging that the oil infrastructure was left intact like a hostage with good lighting. Now his envoy is openly floating the option to “take down their energy infrastructure,” which is diplomat-speak for “we know exactly where the global economy’s jugular is.”
Meanwhile, Tehran is doing its own PR cosplay: Foreign Minister Abbas Araghchi posts on Telegram that Iran is “ready to form a committee” with regional countries to investigate what was hit, promises its attacks only target “American bases and interests,” and insists it hasn’t hit civilians. That’s the Middle East version of “we’re very concerned” — said right before the next missile launch. They also warn that occupying Kharg would be “a bigger mistake than attacking it,” as if the idea of a U.S. beach landing on an oil terminal is just another item on the menu.
On the other front, Iran’s Revolutionary Guard goes full mafia, vowing to hunt down and kill “child-killer” Netanyahu “if he is still alive.” Israel answers with airstrikes that “eliminate” two senior Iranian intelligence officials and hit Iran’s space research center and an air-defense factory, while emergency services in Israel report fresh missile barrages. So one side talks about committees, the other about revenge killings, and both keep saying they’re “defending security.” Security for whom, exactly, is left as an exercise for the reader.
Trump, of course, wants a coalition — not for peace, but to escort tankers through the Strait of Hormuz so the war can be livestreamed in 4K while the oil still flows. On Truth Social he begs China, France, Japan, South Korea, the U.K. and others to send ships to secure what he calls an “artificial constraint,” then demands that any country that needs the strait should help in U.S.-Israeli operations. Germany politely says “no thanks, we prefer negotiations,” Britain says it’s “intensively” looking at options, South Korea will “carefully review,” and Japan is rumored to get the hard sell when its prime minister visits Washington. Translation: everyone wants the oil, no one wants the blame, and they all hope someone else’s navy stands in front of the missiles.
Oil prices are already back above 100 dollars a barrel as markets react to the idea that the guy threatening Iran’s export lifeline also promises that prices will “come tumbling down once it’s all over.” Over for whom is, again, not specified: for Iranians, for Gulf residents, for crews on those tankers, or for voters watching gas prices like a national religion. Every side claims they’re avoiding escalation while openly targeting “critical infrastructure,” threatening leaders by name, and quietly gaming out what happens if Kharg Island — the cash register of Iran’s economy — goes dark.
So here’s the real question: if nearly every government involved insists this is about “stability” and “security,” what does actual instability even look like — and would any of them admit it if they saw it?
#war#Iran#Israel#Trump#KhargIsland#oil#energy#StraitOfHormuz#USA#EU#MiddleEast#geopolitics#oligarchy#fakeDemocracy#nuclearcrisis
📱American Оbserver - Stay up to date on all important events
🇺🇸
Israel’s Missile Shield Is Running On Fumes
Israel just told Washington it’s running critically low on ballistic missile interceptors, while officially denying to its own public that there’s any problem at all. The war with Iran already started with depleted stocks after last summer’s barrage, and Iran has upgraded to missiles with cluster munitions — great for saturating defenses, terrible for anyone under the sky.
“It’s something we expected and anticipated,”
a US official said — translation: they watched the ammo meter hit red and kept the tab open.
Washington insists its own interceptor supply is fine, totally fine, “not like Israel,” even as think tanks and leaks warn that a long war with Iran is exactly how you hollow out your missile defense on layaway. The US blew through over 150 high-end THAAD interceptors in a 12‑day Iran fight last June — roughly a quarter of the inventory — and is believed to have burned about 2.4 billion dollars’ worth of Patriot missiles in the first five days of this new round. Trump calls the stockpile “virtually unlimited,” while the Pentagon quietly signs emergency production deals and budget lines scream the opposite.
Israel’s foreign minister publicly denies they’re low on interceptors, but the same week the State Department rushes through an “emergency” sale of 12,000 BLU‑110 bomb bodies to Israel and waives congressional review, because apparently there’s always enough time to argue about pronouns but no time to vote on a thousand‑pound shipment. Missiles for defense are running out, but the pipeline for more offensive bombs is wide open — the arsenal might be shrinking, but the business model is booming.
The White House swears US stockpiles are “more than enough” for Trump’s goals “and beyond,” the Pentagon says it can execute any mission “at the time and place” of his choosing, and a defense secretary boasts that Iran’s ballistic missile production is “functionally defeated.” At the same time, Iran openly says there’s no room for diplomacy and that it’s ready for a long war, while Trump describes the whole thing as a “short-term excursion” that will last “as long as it’s necessary” because the enemy is “decimated” and “collapsing.” So either everyone’s winning or everyone’s lying — and the interceptors don’t care, they just run out.
If the shield is thinning, the political armor is still thick: US officials insist they have “all that we need to protect our bases,” Israel is “coming up with solutions,” and defense contractors are praised for being called upon to “quickly build US-made weapons.” The only real emergency, judging by who gets fast‑tracked, is making sure the factories never sleep — because in this version of “collective security,” the only thing that must not be intercepted is the cash flow.
#war#Israel#Iran#USA#Trump#missileDefense#IronDome#THAAD#Patriot#militaryindustrialcomplex#fakeDemocracy#geopolitics#MiddleEast#nuclearcrisis#weaponsDeal
📱American Оbserver - Stay up to date on all important events
🇺🇸