В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
🔥 BingX $SING Fixed Savings is LIVE! 🚀
💰 Earn up to 200% APR by staking your $SING!
🏃♂️ Limited quota – subscribe now before it’s gone!
📅 Subscription Period: Now – Nov 24, 2024, 07:00 AM (UTC)
🔗 Start Staking: https://bingx.com/en/wealth/subscription?actId=&assetName=SING&productId=1374930318547673175&productType=1
⏳ Don’t miss out on this incredible earning opportunity!
#BingX#SingSing#Staking#CryptoEarnings
🔥 MetaGram: MGR Staking is LIVE
Stake your $MGR and earn up to 80% APR.
• Flexible lock terms: 7–365 days
• 0% platform fees while staking
• Trading pair: MGR/BNB (details soon)
👉Start now 👉👉👉👉👉👉👉👉
👉https://metagram.digital/staking
#MetaGram#MGR#DeFi#BSC#Staking#CryptoEarnings
🔥 MetaGram: MGR Staking is LIVE
Stake your $MGR and earn up to 80% APR.
• Flexible lock terms: 7–365 days
• 0% platform fees while staking
• Trading pair: MGR/BNB (details soon)
👉Start now 👉👉👉👉👉👉👉👉
👉https://metagram.digital/staking
#MetaGram#MGR#DeFi#BSC#Staking#CryptoEarnings
🔥 MetaGram: MGR Staking is LIVE
Stake your $MGR and earn up to 80% APR.
• Flexible lock terms: 7–365 days
• 0% platform fees while staking
• Trading pair: MGR/BNB (details soon)
👉Start now 👉👉👉👉👉👉👉👉
👉https://metagram.digital/staking
#MetaGram#MGR#DeFi#BSC#Staking#CryptoEarnings
🚀 USDC Holders May Face End of 4% Earnings Amid Legislative Push
PANews posted on X (formerly Twitter) that the days of earning a 4% return by holding USDC might be coming to an end. The American Bankers Association (ABA) has reportedly spent $56.7 million lobbying for the passage of the 'Clarity Act.' The primary aim of this legislation is to prevent users from obtaining returns similar to government bonds through stablecoin holdings. The banking sector's main concern is that if stablecoins can offer an annualized return of 4% to 5%, it could potentially impact up to $1.5 trillion in retail deposits.
#USDC#Stablecoin#ClarityAct#AmericanBankersAssociation#CryptoRegulation#CryptoEarnings#BankingSector#Legislation#RetailDeposits
🔥@CryptoDailyPrice – Your shortcut to daily crypto power! 💰
Get live price updates, learn pro trading tricks, and discover zero-investment earning hacks that actually work. 🚀
Stay tuned — every post drops something crucial, profitable, and mind-opening for crypto lovers like you! ⚡
#CryptoDailyPrice#CryptoUpdates#CryptoEarnings#CryptoTrading#CryptoTips#LearnToTrade#ZeroInvestment#CryptoForBeginners#DailyCryptoNews#PassiveIncome#CryptoSignals#CryptoMarket#CryptoProfit#StayTuned#EarnWithCrypto
💸 New Payment Received from Tonpick Faucet! 💸
💰 Hourly TON Faucet — Earn free TON easily!
✅ Claim faucet every 60 minutes
✅ Confirm your email to get 10 spins & 2X rewards for 24h
✅ Complete surveys for extra rewards
✅ Invite friends & earn 50% from their claims
💵 Min withdraw: only 0.1 TON
🌐 Join here:
https://tonpick.game/?ref=FREE_CRYPTO_TG
#TON#FreeTON#CryptoFaucet#CryptoEarnings#MakeMoneyOnline#Airdrop#FreeCrypto#PassiveIncome#WorkFromHome#CryptoRewards
---
💸 دفعة جديدة من Faucet Tonpick! 💸
💰 صنبور TON كل ساعة — اربح TON مجانًا بسهولة!
✅ المطالبة بالصنبور كل 60 دقيقة
✅ تأكيد بريدك الإلكتروني لتحصل على 10 دورات و ضعف الأرباح لمدة 24 ساعة
✅ إكمال الاستبيانات لربح إضافي
✅ دعوة الأصدقاء وربح 50% من أرباحهم
💵 الحد الأدنى للسحب: فقط 0.1 TON
سجّل الآن:
https://tonpick.game/?ref=FREE_CRYPTO_TG
#ربح_المال#كريبتو#TON#ربح_TON#ايردروب#PassiveIncome#ربح_مجاني#بوتات_تيليجرام#ربح_من_الانترنت