В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
Any form of meningitis is a medical emergency.
Download our latest #CerebrospinalMeningitis situation report for a summary of the disease situation and our response activities
🔗
https://ncdc.gov.ng/diseases/sitreps/?cat=6&name=An%20Update%20of%20Meningitis%20Outbreak%20in%20Nigeria
We have published our latest situation report on #CerebrospinalMeningitis.
This report provides a summary of the current epidemiological situation in Nigeria, and our preparedness and response activities.
🔗https://ncdc.gov.ng/diseases/sitreps/?cat=6&name=An%20Update%20of%20Meningitis%20Outbreak%20in%20Nigeria
#TakeResponsibility
The highest burden of #CerebrospinalMeningitis in Nigeria occurs in the “Meningitis Belt” which includes all 19 states in the Northern region, the FCT, and some southern states.
Ensure you and your loved ones have received the appropriate vaccination required to protect against #meningitis
Public Health Advisory: https://ncdc.gov.ng/news/508/cerebrospinal-meningitis-public-health-advisory
Vaccination is the best prevention measure against #CerebrospinalMeningitis.
Ensure you complete the routine immunisation for your children or wards to keep them safe and #healthy.
#TakeResponsibility
#CerebrospinalMeningitis (CSM) is an easily transmissible disease with confirmed cases reported all year round in Nigeria.
Download our latest #CSM situation report for a summary of the disease situation and our response activities
🔗https://ncdc.gov.ng/diseases/sitreps/?cat=6&name=An%20Update%20of%20Meningitis%20Outbreak%20in%20Nigeria
#TakeResponsibility
Vaccination is the best prevention measure against #CerebrospinalMeningitis.
Ensure you complete Nigeria's routine immunisation schedule for your children or wards to keep them safe and #healthy.
#DefeatMeningitis
Are you familiar with the signs of #Meningitis in ADULTS?
Know the signs and symptoms to report early to a healthcare facility when noticed.
#CerebrospinalMeningitis is a MEDICAL EMERGENCY!
#StaySafeStayHealthy#WorldMeningitisDay
🔗
https://youtu.be/ZhZdin-Cn9s?feature=shared
Vaccination is the best prevention measure against #CerebrospinalMeningitis.
Ensure you complete Nigeria's routine immunisation schedule for your children or wards to keep them #safe from vaccine-preventable diseases.
#DefeatMeningitis
#WorldMeningitisDay