В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
🔥TokenPocket Now supports Linea DeFi Assets Management! Powered by Blockin.ai!
Open your TokenPocket 📲 Assets Page ➡️ DeFi Entrance ➡️manage all your #DeFibehaviors including #Staking, #Deposits, #Farming, #Lending, #LiquidityPools etc.
👉https://tokenpocket.pro
Whales Bring Stablecoins to Exchanges
🔹 After the Christmas crypto market dip, a positive trend emerges as whales deposit stablecoins into exchanges.
🔹 Last 24 hours: 7 deposits of $FDUSD on Binance, each at least $9M; one as high as $50M.
🔹 Deposits linked to new launchpool of Bioprotocol $BIO.
🔹 Large stablecoin deposits indicate whales are gearing up for purchases, potentially boosting market prices.
🔹 Bitcoin spot ETFs halted a 4-day outflow streak with $475M inflow yesterday, while Ethereum funds attracted $117M.
More details on whale activity | ETF inflow information
#Crypto#Stablecoins#Binance#Whales#Bioprotocol#ETF#Bitcoin#Ethereum#MarketTrends#Investment#Finance#CryptoMarket#Trading#FDUSD#Launchpool#Deposits#Inflows#PriceAction#HODL#VC
Justin Sun Transfers $245M in ETH
Justin Sun's team has transferred 70,182 ETH to HTX, valued at approximately $245 million. This includes 42,905 ETH unlocked from Lido Finance and 27,277 ETH from Etherfi. Since November 10, Sun has deposited 179,101 ETH worth about $645 million in total, averaging $3,601 per ETH. Analysts suggest Ethereum could outperform Bitcoin in January 2025, potentially increasing the ETH/BTC ratio above 0.04, which may spur altcoin growth. Historical Bitcoin prices show significant growth leading up to Christmas over the years with predictions continuing for 2025. Spot On Chain | Cointelegraph | Simply Bitcoin TV
#Ethereum#BTC#JustinSun#HTX#LidoFinance#Etherfi#Crypto#PriceAnalysis#MarketTrends#Altcoins#ETHBTC#Deposits#Blockchain#Trading#Fundamentals#Investing#CryptoHistory#FuturePredictions#ETFs#Growth
🚀Big news! With the support of Debank and Blockin.ai, we're thrilled to unveil the integration of 10 New Chains for DeFi Asset Management on #TokenPocket: #Gnosischain, #Arbitrum, #Klaytn, #Avalanche, #Aurora, #Conflux, #BTT, #Nova, #ZKsync, and #EOS EVM.
💪Combined with our existing support for #ETH, #BSC, #Matic, #OP, #Moonbeam, #Heco, #FTM, #OKTC, and #Harmony, we now support a total of 19 Chains!
📲On your wallet's assets page ➡️DeFi Entrance ➡️manage your #DeFi assets, explore #Staking, #Deposits, #Farming, #Lending, #LiquidityPools, and More — all of these on-chain #DeFibehaviors.
🔥Explore and manage your DeFi Assets seamlessly with the power of 👉TokenPocket. Check it out today! #DeFi#blockchain#tokenpocket