В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
🔥NEW RELEASE🔥
😁Dynamically Combining Inside & Outside Passing by Jason Rau😁
➡️Unlock a truly adaptive guard passing game with Jason Rau’s groundbreaking system that seamlessly blends tight inside pressure passing with loose outside movement.
➡️Learn how to fluidly switch between styles depending on your opponent’s reactions, making your passing game feel unpredictable, overwhelming, and unshakable.
$127😍$11.99😍
❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️
📱Payment: 📱📱📱
💰Submeta FOR FREE
🌈UFC Picks
👑MasterClass
✈️@bjjfanaticsinstructionals
#JasonRau#Passing#NoGi#ADCC
💁♀️Buy
💁♀️
🔥NEW RELEASE🔥
😁Understanding The Reap By Jason Rau😁
➡️Unlock the power of one of Brazilian Jiu-Jitsu’s most misunderstood and effective positions with Understanding The Reap by Jason Rau.
➡️This incredibly comprehensive course takes you deep into the intricacies of the "reap" — a position that is often overlooked, yet crucial for mastering lower body submissions, sweeps, guard passes, and even back takes.
➡️Whether you’re a beginner or an advanced practitioner, Jason Rau’s detailed breakdown of the reap will give you the tools to control and submit your opponent, defend with confidence, and add an entirely new dimension to your BJJ game.
$99😍$9.99😍
❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️
📱Payment: 📱📱📱
💰Submeta FOR FREE
🌈UFC Picks
👑MasterClass
✈️@bjjfanaticsinstructionals
#JasonRau#BJJFanatics#NoGi#Leglocks
💁♀️Buy
💁♀️
🔥NEW RELEASE🔥
😁Outside Ashi Reloaded by Jason Rau😁
➡️Take your leg lock game to the next level with Outside Ashi Reloaded, an innovative instructional series by Jason Rau — a black belt under Matt Serra and one of our best-selling instructors.
➡️Jason dives deep into the strategic interplay between these attacks, teaching you how to create relentless pressure and chain submissions so that when your opponent defends one, they inevitably expose themselves to the other.
$127😍$11.99😍
❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️
📱Payment: 📱📱📱
💰Submeta FOR FREE
🌈UFC Picks
👑MasterClass
✈️@bjjfanaticsinstructionals
#JasonRau#Leglocks#NoGi#OutsideAshi
💁♀️Buy
💁♀️
🔥NEW RELEASE🔥
😁Dynamically Taking The Back (Turtle) by Jason Rau😁
➡️Unlock the Ultimate Back-Taking Blueprint from Turtle with Dynamically Taking the Back (Turtle) — the revolutionary course by elite BJJ black belt Jason Rao, designed to take your control, timing, and back-attack game to a whole new level.
➡️From gripping strategies and handfighting to dynamic movement and pressure mechanics, you’ll learn how to turn every turtle situation into a back take with confidence and precision.
$99😍$9.99😍
❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️
📱Payment: 📱📱📱
💰Submeta FOR FREE
👑MasterClass
✈️@bjjfanaticsinstructionals
#JasonRau#Turtle#NoGi#ADCC
💁♀️Buy
💁♀️