В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
🚨3️⃣3️⃣3️⃣3️⃣4️⃣4️⃣4️⃣4️⃣4️⃣
Dear Prospective students,
We would like to remind you that just 3 days left to submit the applications for the IUT's second entrance exams. Thus, do not miss out the opportunity! Hurry up to register and get ready to embark on this extraordinary academic journey with IUT!
📱Application platform
🖱
⏳Deadline: June 14 (Friday) by 5 PM
🎬Application process tutorial
🔔Those applicants who got already registered, are kindly asked to pay the application fee using your Payment ID (sent to your email) via 🏦 , 💸 , 💸 appsby June 17, 5 PM to be able to take the entrance exam.
For more detailed information:
📞71 289 99 99 (0400)
✈️@askinhabot
Best regards,
IUT Admissions Team
#IUT#Admissions2024#ApplicationDeadline
☄️🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠☄️
Attention all prospective students! Please kindly note that the deadline for the application submission for the second entrance exams of IUT is today, June 14, by 5 PM.
This is a last chance for those who want to register for the exam now or re-submit the application in case any mistakes are found after reviewing.
📱Application platform
🖱
Please, don't hesitate to reach out to us if you have any last-minute questions or need assistance with your application via:
📞71 289 99 99 (0400)
✈️@askinhabot
➖➖➖➖➖➖➖➖➖➖
🎬Application process tutorial
Best of luck on your application process and exams!
IUT Admission Team
#IUTAdmissions2024#ApplicationDeadline#ProspectiveStudents#GoodLuck
☄️🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠☄️
Attention all prospective students! Please kindly note that the deadline for the application submission for the second entrance exams of IUT is today, June 14, by 5 PM.
This is a last chance for those who want to register for the exam now or re-submit the application in case any mistakes are found after reviewing.
📱Application platform🖱
Please, don't hesitate to reach out to us if you have any last-minute questions or need assistance with your application via:
📞71 289 99 99 (0400)
✈️@askinhabot
➖➖➖➖➖➖➖➖➖➖
🎬Application process tutorial
Best of luck on your application process and exams!
IUT Admission Team
#IUTAdmissions2024#ApplicationDeadline#ProspectiveStudents#GoodLuck