В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
Sub inițiativa Agenției Statelor Unite pentru Dezvoltare Internațională ( USAID - US Agency for International Development ) și Asociația Națională a Comisiilor de Reglementare a Utilităților Publice din SUA ( National Association of Regulatory Utility Commissioners, NARUC), în Skopje, Macedonia de Nord se desfășoară cea de-a doua ediție a programului de formare în leadership pentru femeile aflate la mijlocul carierei Advancing Women Leaders in Energy.
Pentru detalii accesați următorul link: https://t.ly/I01Mp
#EnergyRegulation#genderequality#careerdevelopment#leadership
🌊🐠 Veterinary Students & New Graduates — Ready to Dive into Aquatic Medicine?
The John L. Pitts Aquatic Veterinary Education Scholarship was created to honor reminded Dr. John L. Pitts’ lifelong dedication to advancing aquatic veterinary medicine and mentoring young professionals. Since 2010, this program has helped students and recent graduates explore meaningful careers in aquatic animal health.
Each year, selected applicants receive financial support to attend conferences, participate in externships, present research, or carry out small aquatic veterinary projects. It’s more than funding — it’s a doorway into a growing and impactful field.
If you’re passionate about fish health, aquaculture, marine species, or aquatic welfare, this is your opportunity to take the next step. Applications open in January and close March 31.
Your future in aquatic veterinary medicine could start here. 🌊✨
Link: https://www.wavma.org/scholarships
#VeterinaryMedicine
#AquaticVeterinary
#VetStudents
#ScholarshipOpportunity
#CareerDevelopment
For more scholarships, internships and different Veterinary related opportunities, visit:
@vet_opportunities
@vet_opportunities
@vet_opportunities