В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
The largest holder of $WIF once again borrowed 2M $USDC from #Kamino to buy 894,854 $WIF at $2.24 1 hour ago!
This whale now holds 32.1M $WIF($71M), with a total profit of more than $86M!
The largest holder of $WIF borrowed 4.5M $USDC from #Kamino to buy 2.55M $WIF at $1.76 again 5 hours ago!
This whale now holds 31.2M $WIF($57.4M), with a total profit of more than $74M!
This whale spent $226K to buy 19.86M $WIF at only $0.0114 from Dec 13 to Dec 15, 2023, then registered a domain of "binance-insider.sol" and spent 86,738 $SOL($8.92M) to buy 17.23M $WIF in one transaction.
Check all his trades on $WIF via the image below.
Address:
https://solscan.io/account/mmEAfWkuYjE7Za8oPUkUgY5VmWfNs627qw7jedG4dzc#transfers
🚀 Kamino Introduces Whitelisted Reserves Following Solana Exploit
Kamino has launched Whitelisted Reserves, a smart contract feature designed to restrict lending vault allocations to reserves approved by the protocol. According to NS3.AI, this development comes shortly after the approximately $270 million exploit of the Drift Protocol on Solana. The new feature is now active on all vaults displayed on Kamino's frontend, with withdrawals still dependent on available liquidity.
#Kamino#WhitelistedReserves#Solana#Exploit#LendingVaults#NS3AI#DriftProtocol#SmartContract#CryptoSecurity#SOL
🚀 Solana's Neutral Trade Responds to Drift Attack Impact
Neutral Trade, a quantitative strategy sharing platform within the Solana ecosystem, announced that it is assessing the impact of the Drift attack on its platform and users. According to Foresight News, the team is awaiting further investigation results from Drift. The update includes the suspension and removal of all 'Drift Architecture' vaults from the homepage, although users can still view related positions on the portfolio page. Currently, the homepage only displays the 'Neutral Strategy' proprietary strategy vaults, which are operating normally and have not suffered any losses.
The 'Neutral Strategy' vaults have undergone independent audits by Halborn, Offside Labs, and Quantstamp, and are integrated with FORDEFI's enterprise-grade security solutions. Although the NT Earn vaults had Drift position configurations, Neutral's risk engine detected anomalies during the attack and preemptively withdrew funds to Jupiter Lend and Kamino, preventing any losses.
Neutral Trade is committed to advancing security upgrades and is considering joining the STRIDE ecosystem security program supported by the Solana Foundation. Previously, Neutral Trade reported a loss of approximately $3.67 million due to the Drift attack.
#Solana#NeutralTrade#DriftAttack#CryptoSecurity#DeFi#Blockchain#STRIDE#JupiterLend#Kamino#QuantitativeStrategy#SOL#JUP