В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
🚀 Gas-Free Transfers are now live on Solana!
With TokenPocket, enjoy:
✨ 3 free transfers every day
✨ Fast, reliable on-chain transactions
Make every move cost-effective with #GasFreeWallet💙
→ https://help.tokenpocket.pro/en/wallet-faq-en/solana-wallet/gas-free-service-on-solana
⛽️Gas Fee? Gas Free!
No more worrying about running out of $TRX for gas fees — TokenPocket now supports $USDD for gas payments, with a limited-time subsidy!
Enjoy a smoother, faster, and more efficient experience on the TRON network. #StablecoinWallet#GasFreeWallet
🎥 Watch how it works: https://youtube.com/watch?v=gndDfJBN_cg
🔋Gas-Free Stablecoin Transfers? TokenPocket makes it real.
→ https://help.tokenpocket.pro/en/wallet-operation/stablecoin/gas-free
✅Zero fees, lightning-fast transactions on BNBCHAIN & TRON
✅Trusted by 30M+ users worldwide - fast, affordable, secure.
Experience the future of stablecoin wallets with TokenPocket. #StablecoinWallet#GasFreeWallet
📝 TokenPocket Monthly Report — December 2025
→ https://tokenpocket-gm.medium.com/tokenpocket-monthly-report-december-2025-c0cd0518efa7
In December, TokenPocket launched a series of measures under the theme of technological innovation and community activities, covering multiple dimensions such as multi-chain function upgrades, trading experience, ecosystem cooperation expansion, security protection enhancements, and transfer experience optimization.
🎯#SAFU
TokenPocket's anti-phishing function is comprehensive. Combined with security functions like Privacy Wallet and Passphrase, it jointly safeguards the security of your assets.
🎯#StablecoinWallet & #GasFreeWallet
TokenPocket now supports Multi-Chain Gas Payment with Stablecoins on base, arbitrum, and BNBCHAIN. Combined with 0 gas fee transfers services on trondao, solana, and BNB Chain, this further solidifies TokenPocket as your go-to choice for a Stablecoin Wallet.
📍 All In One, All in TokenPocket
https://t.co/OVU2yXAPqA
🟥The Gas-Free Transfer on TRON on TokenPocket is live! 🍌
😍Get your TRON Gas Coupons NOW!
✅Comment [Gas-Free On TokenPocket] below👇
💰For 100 winners!
💎With TokenPocket’s TRON Gas Coupons, you can save up to 100% on gas costs on the TRON Network, allowing you to enjoy truly GAS-FREE transfers and trading experiences on TRON!
Details👉https://help.tokenpocket.pro/en/wallet-faq-en/tron-wallet/coupon
#TRON#TokenPocket#GasFree#ZeroGas#GasFreeWallet