В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
In Spain, Good Friday is part of Semana Santa (Holy Week). Cities hold large religious processions.
Groups called brotherhoods organize these events. People wear long robes and pointed hoods. They walk slowly as an act of penance.
Huge floats called “pasos” show scenes from the crucifixion of Jesus. These can weigh over a ton and are carried by teams underneath.
Some cities have music with drums and bands. Others stay completely silent. People also sing emotional songs from balconies.
In Seville, processions can last all night. In Málaga, there is a tradition of pardoning a prisoner. In Valladolid, old sculptures from the 16th and 17th centuries are used.
Traditional foods include torrijas and buñuelos.
🇪🇸🕯️🎭🥁
[Read more 1]
[Read more 2]
@googlefactss
#GoodFriday#SemanaSanta#Spain#Traditions#History#Culture