В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
🔒Are you worried about the safety of your digital assets?
That should be the least of your worries with Go! smartchain onboard
Dig deeper here 👇
https://gosmartchain.ai
Tokenization on Go! SmartChain AI. offers enhanced security features to keep your investments safe
In addition to that, your transactions is made permanent and transparent
And your digital assets safe from the risk of fraudulent activities
#Tokenization#BlockchainSecurity#GoSmartChain#DigitalAssets
-----------------
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
🚀 Time to Check In, Go! SmartChain AI Community!
Check in now if you're yet to👇
🔗https://t.me/thegoprojectbot?start=twitter
Here's an another opportunity to increase your daily dose of engagement and rewards! 🎮💰
And once you're in
1. Click "Open App" to get started
2. Tap the Go! token to collect rewards
3. Complete your daily tasks and quests to earn GoXP
Most importantly,
Stay active and climb your way to the top. Your participation paves the way for you 💪
#CheckIn#EarnRewards#GoSmartChain#GoTonapp
-----------------
Join: 🐣X✉️Chat✉️News🤖Discord
Play: 🕹️TON App💻Web App
Info: 🖥Newsletter🌐Website🌐Blog
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