В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
🔁[MOD UPDATE]🔁
FRAG Pro Shooter MOD APK 4.5.2 UPDATE
Experience thrilling FPS gameplay with unique characters, vibrant maps, and exciting modes. 🎮💥 Team up and show your skills today!
🕹Download Now🕹
Game Features:
- Publisher: Oh BiBi
- Version: 4.5.2
- Size: 207.4 MB
- Category: #Action, #Shooter
- MOD Info: Unlimited Resources
Add @APKFreeDownloader_Bot to get any apk you want.
SHOOT ‘EM UP 💫
Hey Space Cadets!
This Friday brought you one more way to earn 💸. We’re over the moon to announce the launch of a fascinating mini-game, Star Dust💫, on To The Moon! Get ready to navigate your ship through an asteroid belt and blast your way to cosmic riches.
✅Asteroid Blasting Action: Use your ship's blaster to shoot and destroy falling asteroids. Different types of asteroids offer different amounts of Space Bucks, so aim and fire!
✅Finger Press Control: Keep your finger pressed on the screen to fire.
✅Level-Based Rewards: The amount of Space Bucks you collect for shooting asteroids is based on your player level. The higher your level, the bigger your rewards!
✅Durable Ship: Don’t worry if you miss a few asteroids—your ship is built to withstand the hits. Play to your heart’s content, once you’ve had enough, just press the cross at the upper right corner to exit and collect space bucks.
Ready to dive into the asteroid belt and rack up those Space Bucks? Head to the Play tab andget started🚀. May your blasters be swift and your aim true!
Stellar adventures start here:@moon_land_bot🚀
Website | Telegram Chat | X | Discord | Medium
#ToTheMoon#MoonPlay#ecosystem#blockchain#gamefi#web3#wenlisting#airdropsoon#communityfirst#taptap#clicker#game#invitefriends#shooter
«Я готов хоть траншеи копать, и актерство — не главное в моей жизни».
Сегодня Марку Уолбергу исполнилось 54 года.
#ВИДЕОТЕКА
#MarkWahlberg
#BoogieNights
#TheCorruptor
#TheItalianJob
#TheDeparted
#Shooter
#WeOwnTheNight
#TheFighter
#PainAndGain
#PatriotsDay
#ArthurTheKing