В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
#TakeResponsibility
If you observe any of these signs and symptoms, visit a healthcare facility for an accurate diagnosis and treatment.
Ensure you take extra precautionary measures while visiting to prevent the risk of spread.
Fake news can cause unnecessary anxiety and panic. PAUSE, and verify before you share!
Citizens are urged to take the recommended actions required to protect their families, friends, and selves.
🔗
https://ncdc.gov.ng/news/493/official-statement-on-the-new-covid-19-subvariants
#TakeResponsibility
Seek the advice of a qualified healthcare professional when you feel sick.
Self-medication can be harmful.
#TakeResponsibility by using antimicrobials appropriately
Seek the advice of a qualified healthcare professional when you feel sick.
Self-medication can be harmful.
#TakeResponsibility by using antimicrobials appropriately
Meningitis can affect any age group but is more common in children and young adults.
Visit a health center facility for immediate attention if you observe any of the below symptoms.
#TakeResponsibility to stay safe
Drugs save lives, however, they can harm when not taken properly.
Using drugs “anyhow” makes the treatment of infections more difficult.
Visit a healthcare professional when sick for accurate diagnosis and treatment.
Do not self-medicate!
#TakeResponsibility
Parents & caregivers should ensure that their children/wards receive the anti-diphtheria vaccine as recommended in the NPHCDA childhood immunisation schedule.
Visit a primary health care centre close to you to get the vaccine.
#TakeResponsibility
Parents & caregivers should ensure that their children are fully vaccinated against diphtheria with three (3) doses of the pentavalent vaccine as recommended in the childhood immunisation schedule.
#TakeResponsibility to protect yourself & loved ones
🔗
https://ncdc.gov.ng/news/435/diphtheria-public-health-advisory-amidst-outbreak-in-nigeria
The elderly, immunocompromised and those with existing health concerns are advised to:
➡️Wear face masks in outdoor spaces
➡️Wash hands regularly with clean water and soap
➡️Use hand sanitisers
➡️Avoid large gatherings
#TakeResponsibility to stay safe and healthy.
A clean environment and proper hygiene limit the spread of infectious diseases.
Clean all surfaces frequently and do not share personal items.
#TakeResponsibility to protect yourself and your loved ones.
To protect yourself and loved ones from Ebola virus disease, #TakeResponsibility:
✅Wash your hands using soap and running water
⛔Avoid direct handling of dead bats, monkeys etc
⛔Avoid physical contact with anyone with undiagnosed symptoms
📜Advisory
https://ncdc.gov.ng/news/423/public-health-advisory-following-declaration-of-ebola-virus-disease-outbreak-in-uganda
ДжоПи:
Как найти вопрос, на который не знаешь ответа?
Это как найти шапку, которую уже надел,
Но забыл об этом.
Как пристроить ответ, на который не задан вопрос?
(У меня их столько за жизнь заготовлено.)
Как снежков налепить в одиночку,
а не в кого бросить.
Вот прибрался в комнате,
и день прошёл.
А план не изменился.
#bitnev#стихи#takeresponsibility