В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
Major Updates on Bitcoin and Ethereum
🔗 *Roman Storm secures legal funding for trial* with support from Paradigm and Vitalik Buterin! Details here: Leviathan News.
🔗 David Sacks confirmed evaluating a *national Bitcoin reserve* is a priority for Trump's Digital Assets Task Force. BTC is touted a *superior store of value*. Regulations on crypto incoming within six months!
🔗 XRP Ledger briefly halted due to validation issues but self-healed. More info: Coindesk.
🔗 Hong Kong weighs *Bitcoin as a strategic reserve*, urging to accelerate feasibility studies. Insights here: Wu Blockchain News.
🔗 Ethereum's *supply rises* back to pre-merge levels due to Dencun upgrade, signaling inflation. More: The Block.
🔗 U.S. to consider Bitcoin reserve as an essential economic security asset; institutional adoption underway!
#Bitcoin#BTC#Ethereum#ETH#Crypto#Legal#Funding#XRP#Regulations#HongKong#StrategicReserve#DigitalAssets#AI#VC#MicroStrategy#Inflation#Securities#DeFi#Stocks#Bonds#ETFs
U.S. Bitcoin Reserve Announced by Trump
President Trump establishes a U.S. Strategic Bitcoin Reserve using forfeited assets, ceasing prior sales of confiscated Bitcoin. Current U.S. holdings include about 200,000 BTC, with only 86,000 BTC available for reserves. Crypto markets react as Bitcoin price drops $5,000. The reserve aims to act as a digital savings medium without taxpayer costs. For further details, read the full story here: Axios.
#Bitcoin#Crypto#VC#Trump#Reserve#Bitfinex#Blockchain#Government#Assets#CryptoMarket#DigitalAssets#StrategicReserve#Forfeited#Volatility#MarketReaction#InvestorNews#USeconomy
Crypto Advocate Ramaswamy Eyes Ohio Governance
Vivek Ramaswamy, a crypto proponent and new leader of the Department of Government Efficiency (DOGE), is set to announce his candidacy for Ohio governor soon. He advocates for unrestricted use of self-hosted crypto wallets.
In other news, TON DeFi lender EVAA Protocol raised $2.5 million in a private token sale. 🤝 Meanwhile, Massachusetts Senator Peter Durant introduced legislation for a Strategic #Bitcoin Reserve. 💼
Notably, Q4 2024 saw a significant rebound in crypto VC investment, totaling $3.5 billion, a 46% increase from the previous quarter.
📈 In crypto price updates, Bitcoin recently reached $106,000 with a 55% rise over the past 90 days. Coinbase publicly supports the US Government's Strategic Bitcoin Reserve initiative.
For more details:
- Ramaswamy's Candidacy
- EVAA Protocol Fundraiser
- Crypto VC Investment Data
- Coinbase's Support for Bitcoin Reserve
#Crypto#VC#Bitcoin#TON#DeFi#EVAA#Investment#Government#Candidacy#Ohio#Ramaswamy#Coinbase#Regulation#SelfHostedWallets#StrategicReserve#Blockchain#Finance#CryptoMarket#CryptoNews
Trump Establishes Strategic Bitcoin Reserve
Former President Trump has signed an order to create a strategic Bitcoin reserve in the U.S., based on approximately 200,000 BTC confiscated by the government. This reserve will serve as a savings asset, not intended for sale, acting as a digital Fort Knox. Meanwhile, analysts indicate that governments may follow the U.S. lead, reducing the likelihood of Bitcoin bans from regulators. Post-announcement, Bitcoin saw a price drop from $91,000 to $85,000 but has since recovered to $88,000. No altcoins are currently included in the reserve plans. Full details here: Reuters
#Bitcoin#crypto#Trumpr#US#Blockchain#Finance#Regulation#Assets#DigitalCurrency#Investments#Savings#Market#Trading#Reserves#Government#FTX#Securities#FortKnox#Economy#PriceDrop#StrategicReserve
Public Companies and El Salvador Boost Bitcoin
Two U.S. companies enhance Bitcoin holdings: Thumzup Media invests $1M, shifting 90% of assets to Bitcoin and considering Bitcoin payments for workers. KULR Technology acquires $21M in Bitcoin, totaling $42M. El Salvador buys an additional 11 Bitcoin for its reserves. Meanwhile, Oklahoma proposes SB 325 to allow Bitcoin payments and seeks a payment processor by 2026. Decrypt | Oklahoma Bill
#Bitcoin#ElSalvador#PublicCompanies#Investment#Crypto#Thumzup#KULR#Finance#PaymentProcessing#Legislation#Oklahoma#TaxGuidance#DigitalAssets#Reserves#StrategicReserve#Blockchain#Assets#CryptoNews#SB325#VC