В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
⚡️Go! Smartchain is bridging the gap with Realfi, a ground breaking hybrid financial system⚡️
Peruse through the Go! Blog posts for some special knowledge
🔗https://gosmartchain.ai/blog
RealFi is a revolutionary approach that combines the stability of the traditional financial system with the innovations of DeFi.
It's profitability to you can be seen in the;
1️⃣ Lower costs
2️⃣ Enhanced liquidity
3️⃣ Improved security
4️⃣ Greater accessibility
5️⃣ Innovative financial products
With Go!, you can access essential services and make a positive impact on your community. Join the RealFi revolution now💪
#finance#Realfi#Defi#Innovation#blockchain
Join: 🐣X✉️Chat✉️News🤖Discord
Play: 🕹️TON App💻Web App
Info: 🖥Newsletter🌐Website🌐Blog
🌟 Revolutionize with RealFi by Go! SmartChain AI! 🌟
Here's a sneak peak into how Realfi is transforming communities with Go!👇
🔗https://goplatform.io/blog/introducing-realfi-transforming-communities-with-decentralized-ai
RealFi represents a significant leap in integrating AI, blockchain, and community-driven initiatives
With the ability to tokenize anything in seconds, RealFi makes the process simple, fun, and rewarding for you to participate and benefit.
Join Go! on this transformative journey.
#Realfi#Gosmartchain#AI#blockchain#tokenize
-------------------------
Join: 🐣X✉️Chat✉️News🤖Discord
Play: 🕹️TON App💻Web App
Info: 🖥Newsletter🌐Website🌐Blog
Every transaction tells a story.
Validated. Broadcast. Secured on Go! SmartChain.
This is how real-world value becomes digital — fast, transparent, and verified.
💡 Try it yourself: https://app.gosmartchain.ai
#GSMC#GoSmartChain#RWA#RealFi#Blockchain
Owning real assets just got easier.
Buy, trade, and track tokenized assets directly with $GSMC in one seamless experience.
Real value. Real ownership. RealFi in motion.
🌐https://app.gosmartchain.ai
#GSMC#GoSmartChain#RWA#Tokenization#RealFi
🚀 Ready to build & secure the future of decentralized finance? Dive into a day in the life of a developer & validator on the Lysa Testnet! Learn how to create dApps, validate blocks, and earn rewards on Go! SmartChain AI. Explore more👇
👉https://tally.so/r/wQYoxl
#Blockchain#DeFi#RealFi#LysaTestnet#GoSmartChain#developers#validators#BlockchainGaming
-----------------
Join: 🐣X✉️Chat✉️News🤖Discord
Play: 🕹️TON App💻Web App
Info: 🖥Newsletter🌐Website🌐Blog