В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
Methylene Blue and Nicotine Patch in Cancer Treatment with Dr. Silva
"In cancer, I think, It is actually wonderful because what it, methylene blue is, it's an electron carrier and an oxygen carrier. So this is what helps clean out the mitochondria and oxygenates the system. I also love the nicotine patch. Okay, this is something that helps excrete the virus."
Watch the entire episode at #ManInAmerica (https://jiii.io/jpgpml)
Shocking Truth: Oncologists BANNED from Discussing Cheap Cancer Cures? 🚨
The truth about cancer treatment: Drugs like Ivermectin and Fenbendazole, which are off patent and dirt cheap, are off limits for discussion. Oncologists at top tier hospitals like MD Anderson and Johns Hopkins can't even mention them, despite peer-reviewed evidence supporting their use. Why? Because Big Pharma dictates what treatments are 'allowed.' Patients are turning to me for alternatives because the system is broken.
Time to question the status quo in cancer care. Your life might depend on it.
Share if you support the right to know about all cancer treatment options! #Cancer#BigPharma#ManInAmerica