В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
🔍 Police found no fault in fatal car crash involving Sen. Menendez's wife. Investigation opened to ensure proper handling by officers. Victim was jaywalking with drugs and alcohol in his system. Dashcam audio suggests possible intoxication. Democrat senator facing separate bribery charges. Wife not criminally charged. Tragic accident under scrutiny. #Corruption#Politics#JusticeDelayed
https://www.foxnews.com/politics/democrat-sen-bob-menendezs-wife-2018-fatal-car-crash-nj-ags-microscope-reports
Subscribe to @BadVolfNews
This is a haunting question that cuts to the heart of Ethiopia’s ongoing cycle of political violence.
“What are we giving birth to through all this killing?”
In this powerful reflection from The Standard Signal EP.16, the conversation confronts the brutal reality of unresolved killings, missing justice, and the human cost of political conflict—from Negele Borena to Harar to Ambo.
Two years after the assassination of Bate Urgessa, the questions of accountability and justice remain painfully unanswered.
🎥 Watch the full episode of The Standard Signal on: https://www.youtube.com/watch?v=gAXvr9JN3Y8
#BateUrgessa#Ethiopia#JusticeDelayed#HumanRights#PoliticalViolence#TheStandardSignal#NeverForget
#Premiering_now: Two Years Without Justice: Remembering the BrutalAssassination of Bate Urgessa
April 9, 2024, a night that ended in a brutal execution a husband, a father of five, an intellectual and a peaceful politician.
Two years later, the questions remain.
Click here to watch: https://youtu.be/gAXvr9JN3Y8?si=q7C8otTOvcTw_fZ5
In this commemorative episode of The Standard Signal, host Tsedale Lemma discusses with Prof. Ezekiel Gebissa to revisit the life, final hours, and aftermath of Bate Urgessa’s brutal assassination by government forces, and examine what has (and hasn’t) changed since.
#BateUrgessa#Ethiopia#JusticeDelayed#HumanRights#Oromo#OLF#PoliticalViolence#Accountability#AfricaNews#HornOfAfrica#TheStandardSignal#NeverForget
The Standard Signal Ep 16| Two Years Without Justice: Remembering the Brutal Assassination of Bate Urgessa
On April 9, 2024, Bate Urgessa was brutally assassinated by government forces.
This special episode revisits the timeline, and what it reveals about justice and political space in Ethiopia today.
#TsedaleLemma in conversation with #EzekielGebissa
Premiers tonight at 7:30 PM EAT
Subscribe to watch: https://youtube.com/@addisstandard
#BateUrgessa#Ethiopia#Anniversary#JusticeDelayed#HumanRights#PoliticalViolence#Oromo#OLF#Accountability#HornOfAfrica#TheStandardSignal