В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
El Tottenham perdió 2-0 contra el Manchester City, y con ese resultado el Aston Villa volvió a la champions después de 41 años
Increíble temporada de los villanos🦁
@Fut_planet⚜️#UCL🇪🇺
#AstonVilla🏴
⚽️🇪🇺Champions
Aston Villa 1-0 Bayern#Champions#AstonVilla#Bayern
El regreso de la Copa de Europa a Villa Park -cuatro décadas después- no pudo ser más emotivo. Ni el príncipe Guillermo, 'villano' reconocido', se lo quiso perder. El Aston Villa de Unai Emery recibía al Bayern, el equipo frente al que ganó su primera y única 'orejona' en 1982. Los tres puntos se quedaban en Villa Park. Los 'villanos' son los 'héroes'.
https://www.marca.com/futbol/champions-league/cronica/2024/10/02/66fda028268e3e48788b45a0.html
Otros marcadores
Shakhtar 0-3 Atalanta
D. Zagreb 2-2 Mónaco
Liverpool 2-0 Bolonia
Leipzig 2-3 Juventus
Sturm Graz 0-1 Brujas
🏆@Info288_deportes
⚽️🇪🇺Champions
Aston Villa 0-0 Juventus#Champions#AstonVilla#Juventus
Entre 2016 y 2018, Emery y Motta tuvieron tiempo para conocerse como entrenador y jugador en el PSG y anoche, en su primer duelo en los banquillos al frente de dos campeones de Europa como Aston Villa y una Juventus en cuadro, se anularon mutuamente con un empate (0-0) que deja a ambos fuera del TOP-8. Ambos equipos tuvieron sus opciones... y la 'Vecchia Signora' se salvó en el descuento tras el gol anulado a Rogers.
https://www.marca.com/futbol/champions-league/cronica/2024/11/27/6747696cca4741b56f8b4574.html
Otros marcadores
Estrella Roja 5-1 Stuttgart
Bolonia 1-2 Lille
Celtic 1-1 Brujas
D. Zagreb 0-3 Dortmund
Monaco 2-3 Benfica
PSV 3-2 Shakhtar
🏆@Info288_deportes
England Premier League🏴
2026-05-15 19:00 UTC
Aston Villa vs. Liverpool
Predicted outcome: Liverpool
Predicted score: 2:3
Current: 0:0 23'
#AstonVilla#Liverpool#Live
#Football#PremierLeague
UEFA Europa League🌍
2026-05-07 19:00 UTC
Aston Villa vs. Nottingham Forest
Predicted outcome: Aston Villa✅
Predicted score: 2:1
Actual: Aston Villa 4:0
#AstonVilla#NottinghamForest
2026-05-07 19:00 UTC
SC Freiburg vs. SC Braga
Predicted outcome: SC Freiburg✅
Predicted score: 2:1
Actual: SC Freiburg 3:1
#Freiburg#Braga
#Football#EuropaLeague
UEFA Europa League🌍
2026-04-30 19:00 UTC
Nottingham Forest vs. Aston Villa
Predicted outcome: Aston Villa❌
Predicted score: 1:2
Actual: Nottingham Forest 1:0
#NottinghamForest#AstonVilla
2026-04-30 19:00 UTC
SC Braga vs. SC Freiburg
Predicted outcome: Draw❌
Predicted score: 1:1
Actual: SC Braga 2:1
#Braga#Freiburg
#Football#EuropaLeague
UEFA Europa League🌍
2026-04-09 19:00 UTC
SC Freiburg vs. Celta Vigo
Predicted outcome: Draw❌
Predicted score: 1:1
Actual: SC Freiburg 3:0
#Freiburg#CeltaVigo
2026-04-09 19:00 UTC
FC Porto vs. Nottingham Forest
Predicted outcome: Draw✅
Predicted score: 1:1
Actual: Draw 1:1
#Porto#NottinghamForest
🔥 PREMIUM PICK 🔥
2026-04-09 19:00 UTC
Bologna vs. Aston Villa
Predicted outcome: Draw❌
Predicted score: 1:1
Actual: Aston Villa 1:3
#Bologna#AstonVilla
#Football#EuropaLeague
England Premier League🏴
2026-05-03 13:00 UTC
Bournemouth vs. Crystal Palace
Predicted outcome: Bournemouth✅
Predicted score: 2:1
Actual: Bournemouth 3:0
#Bournemouth#CrystalPalace
2026-05-03 14:30 UTC
Manchester United vs. Liverpool
Predicted outcome: Manchester United✅
Predicted score: 2:1
Actual: Manchester United 3:2
#ManchesterUnited#Liverpool
2026-05-03 18:00 UTC
Aston Villa vs. Tottenham
Predicted outcome: Aston Villa❌
Predicted score: 2:1
Actual: Tottenham 1:2
#AstonVilla#Tottenham
#Football#PremierLeague
England Premier League🏴
2026-03-22 12:00 UTC
Newcastle vs. Sunderland
Predicted outcome: Newcastle❌
Predicted score: 2:1
Actual: Sunderland 1:2
#Newcastle#Sunderland
2026-03-22 14:15 UTC
Tottenham vs. Nottingham Forest
Predicted outcome: Draw❌
Predicted score: 2:2
Actual: Nottingham Forest 0:3
#Tottenham#NottinghamForest
2026-03-22 14:15 UTC
Aston Villa vs. West Ham
Predicted outcome: Aston Villa✅
Predicted score: 2:1
Actual: Aston Villa 2:0
#AstonVilla#WestHam
#Football#PremierLeague
UEFA Europa League🌍
2026-04-16 16:45 UTC
Celta Vigo vs. SC Freiburg
Predicted outcome: Draw❌
Predicted score: 1:1
Actual: SC Freiburg 1:3
#CeltaVigo#Freiburg
2026-04-16 19:00 UTC
Nottingham Forest vs. FC Porto
Predicted outcome: Draw❌
Predicted score: 1:1
Actual: Nottingham Forest 1:0
#NottinghamForest#Porto
2026-04-16 19:00 UTC
Aston Villa vs. Bologna
Predicted outcome: Aston Villa✅
Predicted score: 2:1
Actual: Aston Villa 4:0
#AstonVilla#Bologna
2026-04-16 19:00 UTC
Real Betis vs. SC Braga
Predicted outcome: Real Betis❌
Predicted score: 2:0
Actual: SC Braga 2:4
#RealBetis#Braga
#Football#EuropaLeague
England Premier League🏴
2026-05-10 13:00 UTC
Burnley vs. Aston Villa
Predicted outcome: Aston Villa❌
Predicted score: 1:2
Actual: Draw 2:2
#Burnley#AstonVilla
2026-05-10 13:00 UTC
Crystal Palace vs. Everton
Predicted outcome: Everton❌
Predicted score: 1:2
Actual: Draw 2:2
#CrystalPalace#Everton
2026-05-10 13:00 UTC
Nottingham Forest vs. Newcastle
Predicted outcome: Nottingham Forest❌
Predicted score: 2:1
Actual: Draw 1:1
#NottinghamForest#Newcastle
2026-05-10 15:30 UTC
West Ham vs. Arsenal
Predicted outcome: Arsenal✅
Predicted score: 1:2
Actual: Arsenal 0:1
#WestHam#Arsenal
#Football#PremierLeague