В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
⚡️🇷🇺🇺🇦⚡️ Two Majors #Summary for the Morning of 15 March 2025; 06:29 (GMT+3)⚡️
🛡More than 20 UAVs were downed by air defence and EW means over the #Voronezh region at night. The governor of the #Bryansk region also reported that an UAV attack had been repelled. Local media reported explosions (15-20) over #Volgograd, with one drone downed near 'Sarepta Station.' The likely target was the local oil refinery, with footage of a fire emerging. During the day, a drone crashed in the centre of #Dzhankoy (#Crimea), injuring 2 women. The UAV damaged a café, and shrapnel struck 2 private houses and a church. There were 3 wounded.
🎯 Russian Forces, in turn, targeted industrial zones and the port in #Odessa and its surroundings with Geranium drones. A fire broke out at an electrical substation following one of the strikes, and the regional administration reported that #Chernomorsk (#Ilyichevsk) was completely blacked out due to damage to the energy infrastructure. The enemy also reported strikes on #Chernigov, #Pavlograd, #Cherkassy, #Starokonstantinov, the Bogodukhovsky district of the #Kharkov region, as well as the #Vinnitsa and #Kiev regions.
🔹 In #Kursk Region, the destruction of remaining enemy forces attempting to retreat into the #Sumy region continues. Trump has stated that thousands of AFU militants are encircled. The final settlements left to be liberated are #Gogolevka, #Gornal, #Oleshnya, and #Guyevo. The enemy is striking liberated territories. AFU Nazis targeted the local history museum in #Sudzha, an architectural monument from the late 19th century. A museum employee, who had remained in the city during the occupation and had come to inspect the building, was killed. 2 other employees were wounded. Since 12 March, 209 residents have been evacuated from the liberated settlements. Amid the Russian Army’s advance and the Supreme Command’s objective of creating a buffer zone, mandatory evacuation has begun in 8 villages near the border in the #Yunakovka and #Miropolye communities of the #Sumy region. Russian forces have already pushed into enemy territory towards #Basovka and #Zhuravka.
Until demining operations are completed, the authorities in the region have imposed temporary entry restrictions in 122 settlements across 6 districts bordering #Ukraine.
🔹 In the North of #Kupyansk Direction, reports indicate clashes with AFU forces near #Figolevka on the right bank of the Oskol.
🔹 In #Pokrovsk Direction, fighting continues near #Udachnoye, #Kotlino, #Peschanoye, #Shevchenko, and #Tarasovka. The enemy claims that Russian units, freed up after the liberation of #Konstantinovka, have been redeployed to #Pokrovsk to increase pressure.
🔹 On the #Vremyevka Ledge, the 'Group of Troops East' continues advancing towards #Bogatyr west of the village. Fighting is ongoing in the areas of #Dneproenergiya and #Burlatskoye.
🔹 On the #Zaporozhye Front, reports indicate Russian success near #Shcherbaki and #MalyeShcherbaki.🗺👆Russian units continue to assault enemy positions in the forest plantations. From the southern side, airborne troops have entered #Shcherbaki, assaulting enemy fortifications and strongpoints. The enemy has pulled back its main forces, leaving observation posts in the village manned with machine gun and rifle crews, supported by artillery and kamikaze drones. #Shcherbaki is nearly cleared. Assault groups of the Russian Airborne Forces are advancing from the south towards #MalyeShcherbaki and from the east towards #Shcherbaki.
💥 In #Belgorod Region, the enemy continues heavy strikes.
#Valuyki, #Kukuyevka, #Murom, #Shebekino, #Tishanka in the Volokonovsky district, and #YasnyeZori in the Belgorod district are under attack.
💥 In #Gorlovka (#DPR), a Nazi drone strike injured a 1951-born woman and a 1981-born man. A 1970-born man was injured by enemy barrel artillery.
📱 Join GLOBAL DEPTH to boost your TG Feed
💬Welcome to Military Chat & Ukraine Observer
🇺🇦On Ukraine Observer you will find your daily independent Ukraine War Battle Update
⚡️
🇷🇺
🇺🇦⚔️ Ukraine Fronts on the Morning of 1 April⚡️
🔴 In #Chernigov Direction, the AFU has reportedly already crossed the Russian border of the #Bryansk region many times. Locals point to periodic incursions towards several villages.
🔴#Sumy Direction:
🔴In #Sudzha Sector, to the west on Ukrainian soil, the situation based on confirmed information and evidence is as follows:
🟡#Vladimirovka- AFU; {1st blue↗️};
🟡#Vodolagi - AFU;
🟡#Uspenovka in Russia - contested {1st black↘️};
🟡#Veselovka - contested {2nd black↖️};
🟡#Belovody - AFU;
🟡 In #Zhuravka, fights in the central part;
🟡 In #Basovka, the RFAF assaults the eastern part.
🟡#Novenkoye - RFAF {1st red⬆️}.
🟡 In #Kursk region, reportedly, Russian troops have repelled an assault on the 'Border Checkpoint' {2nd red↙️}; the AFU have reinforced the battle area around #Oleshnya {4th blue⬅️}.
🟡 In #Guyevo, the RFAF have reportedly extended their control zone {5th black⬇️}.
🟡#Gornal remains AFU controlled.
🔴In #KrasnayaYaruga Sector, reportedly positional battles are taking place in #Popovka {6th black↙️}.
🟡 In #Demidovka, the AFU have advanced in the central part and in the area of the farm in the village's eastern part.
🗺 Map 2
🟡 At #Grafovka and #Prilesye, lull.
🗺 All on Map 1
🔴#Kharkov Direction:
🔴In #Liptsy Section, positional battles.
🔴 In #Volchansk Section, as well in the city itself.
🔴#Svatovo Front:
🔴 In #Kupyansk and #Borovaya Sectors, reportedly slight tactical successes for the RFAF without major changes.
🔴In #Liman Sector, fighting south of #Katerinovka and east of #Novoye in the north.
🔴In #Seversk Sector, west of #Belogorovka, Russian troops reportedly approached #Grigorovka.
🔴#ChasovYar Direction:
🔴In #ChasovYar Sector, the battles continues.
🔴In #Toretsk Sector, fighting in the city and to the west for #Shcherbinovka and #Leonidovka continued.
🔴#Pokrovsk Direction:
🔴 On the right Flank, far to the east, fighting continues at #Valentinovka and in the area of #Panteleymonovka (towards #Toretsk northwards). To the west, urban battles in #Tarasovka.
🔴 South of the City, reportedly Russian advance in #Lysovka. Battles at #Shevchenko and #Peschanoye, and in #Kotlino fighting at the the far southeastern edge.
🔴 On the left Flank, the fighting for #Udachnoye's far southeastern reportedly continued. Otherwise, intense combat is taking place along the entire frontline from #Solenoye southwards.
🔴#Komar Direction:
🔴In #Bogatyr Sector, the battles near #Andreyevka and for #Konstantinopol continue.
🟡 In #Razliv, Russian troops extended the zone of control and raised the flag in the centre of the village.
📌Despite several Russian claims, there is no takeover yet! The village boundaries extend to the west, especially the large buildings with blue roofs are located within them.
🎬 Video
🗺 Map 3
🔴 In #Komar Sector, the RFAF are reportedly attacking towards #Otradnoye and #Komar.
🟡 In #Vesyoloye, the battle for the settlement is ongoing.
🔴#Zaporozhye Direction:
🔴In the #Orekhov Section, south of the city, the AFU positions are reportedly under permanent fire; Russian units are attacking towards #Novoandreyevka. To the west, the fighting especially in the 4 contested villages continues:
🟡#Shcherbaki;
🟡#MalyeShcherbakito the west;
🟡#Stepovoye, further west;
🟡#Lobkovoye;
🟡#Pyatikhatki remains RFAF controlled.
🟡 At #Kamenskoye, in the far west, the RFAF reportedly took one of the AFU's key strongholds.
🔴 In #Kherson Direction, Russian aviation struck Ukrainian positions on the opposite bank, while the AFU targeted villages.
💥 For #OldRussia and #RestUkraine, we have found no reports of new mutual strikes.
⚠️ The Term 'Reportedly' indicates that it is unconfirmed!
🎞 Video Source
🗺 Maps @olegtsarov; @petrenko_iHS@creamy_caprice
📋 Sources: CC; Tsarov;
🇺🇦Fiend;⚡️2M;🐈Cat😼VK
🕰As of 1 Apr 2025; 06:38 GMT+3;📃31 Mar
📱 Join GLOBAL DEPTH to boost your TG Feed
💬Join Military Chat for Comments & Discussions
🇺🇦On Ukraine Observer you will find your daily independent Ukraine War Battle Update
⚡️
🇷🇺
🇺🇦⚔️ Ukraine Fronts on the Morning of 29 March⚡️
🔴#Sumy Direction:
🔴 At #Bryansk Border, mutual strikes.
🔴In #Sudzha Sector, to the west on Ukrainian soil, reportedly the RFAF is about to expand the zone of control on a broad front from #Vladimirovka up to #Basovka:
🟡#Vladimirovka- contested;
🟡#Vodolagi - AFU {2nd blue⬆️};
🟡#Veselovka - taken by the RFAF {1st black⬆️};
🟡#Belovody - AFU {3rd blue⬆️};
🟡#Zhuravka - contested;
🟡#Basovka - contested.
🟡#Novenkoye, RFAF {1st red⬆️}.
🟡 In #Kursk region, reportedly, Russian forces advanced from the 'Border Checkpoint' {3rd red arrow} further south and have entered #Oleshnya 4th blue⬅️}.
🟡#Gogolevka, is reportedly RFAF controlled {2nd red⬇️}.
🟡 In #Guyevo, Russians filmed their presence in the village's north and fights further south {4th black⬅️}.
🎬 Video 1
🟡#Gornal remains under AFU control.
🔴In #KrasnayaYaruga Sector, militants enter #Popovka regularly up to its eastern part under RFAF fire {5th black↙️}.
🗺 Map 2
🟡 In #Demidovka, the AFU controls ca. 50% of the village.
🟡 At #Grafovka, lull.
🟡 At #Prilesye as well.
🗺 All on Map 1
🔴 In #Kharkov Direction, without changes.
🔴#Svatovo Front:
🔴 In #Kupyansk Sector, far north, Russian troops advanced in #Krasnoye1st. RF MoD claims its takeover. Further south, reportedly:
🟡#MalayaShapkovka has been entered;
🟡#Kondrashovka was taken and
🟡#Tischenkovka has been entered.
🔴 In #Borovaya, #Liman and #Seversk Sectors, and...
🔴#ChasovYar Direction, no major changes.
🔴#Pokrovsk Direction:
🔴 On the right Flank, far to the east, battles continue in the #Panteleymonovka area. To the west, for #Tarasovka.
🔴 South of the City, most of #Lysovka is RFAF controlled.
🔴 On the left Flank, the fighting (afore called clearing) continues in #Uspenovka.
🟡 In #Novoaleksandrovka, the battle for the village reportedly goes on.
🟡#Kotlyarovka has been approached by Russian troops. The AFU counterattack.
🟡 At #Bogdanovka, the RFAF advanced to the southern edge of the village.
🔴#Komar Direction:
🔴In #Bogatyr Sector (afore 'Konstantinopol Sector'), the RFAF advanced north of #Andreyevka in westerly direction and closed half of the pocket. Fighting continues to the west of the village (remember, previously the Russians were driven out of positions further west near #Alekseyevka).
🟡 In #Konstantinopol, Russian troops are still trying to regain control over the settlement. The AFU counterattack.
🟡 In #Razliv, the battle has reportedly shifted to the centre.
🟡On #Bogatyr, the RFAF are advancing on a broad front from the south.
🔴 In #Komar Sector, Russian troops move on #Otradnoye, located west of #Bogatyr. To the west, the battle for #Vesyoloye continue.
🔴#Zaporozhye Direction:
🔴In #Orekhov Section, positional fights in the are of#MalayaTokmachka - #Rabotino area. Further west reportedly:
🟡 In #Shcherbaki, the battle continues with varying success.
🟡 In #MalyeShcherbakito the west, the RFAF try to get full control of the village.
🟡 In #Stepovoye, further west, the clashes continued.
🟡 In #Lobkovoye as well.
🟡#Pyatikhatki remains RFAF controlled.
🔴 In #Kherson Direction, the RFAF shelled AFU positions, the AFU, in turn, villages.
💥#Russia:
🔵 The AFU struck the 'Transmash Plant' in #Donetsk (#DPR); in #Lugansk (#LPR), the 'Industrial Zone'; in #Belgorod region, #Stroitel and several villages; and in #Kursk Region, again the 'Sudhza Gas Metering Station' and finished it off.
🎬 Video 2
💥#RestUkraine:
🔵 The RFAF, in turn, struck targets in the #Kiev, #Vinnitsa, #Zhitomir, #Kharkov, #Sumy, #Nikolayev, #Cherkassy, #Poltava, and #Chernigov regions, as well as in #Dnepropetrovsk.
⚠️ The Term 'Reportedly' indicates that it is unconfirmed!
🎞Vids Source 1; Source 2;
🗺 Maps @olegtsarov; @creamy_caprice
📋 Sources: CC; Tsarov; ⚡️2M;
🇺🇦Fiend;😼Kotenok
🕰As of 29 Mar 2025; 06:44 GMT+3;📃28 Mar
📱 Join GLOBAL DEPTH to boost your TG Feed
💬Join Military Chat for Comments & Discussions
🇺🇦On Ukraine Observer you will find your daily independent Ukraine War Battle Update