В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
🚀 To celebrate the partnership with @AEON_Commuinty, the leading crypto payment framework, built for AI to drive intelligent, automated payments across Web3 and simplify how crypto works in real life, we're hosting a GIVEAWAY! 🎉Total $700 Up For Grabs!
⏰May 1st, 10:00 AM - May 20th, 10:00 AM (UTC)
1️⃣$200 raffle for qualified #Galxe participants
2️⃣$500 rewards via AEON Pay for TOP and FCFS consumers
Consume $UXLINK to cover daily expenses (Each transaction must over $5).
👀Stay tuned for the upcoming announcement! In the meantime, feel free to take a sneak peek here 👉https://t.me/aeon_pay_bot
The competition is heating up, and it's time to take your skills to the next level in our #TON Capital #Galxe Campaign!⚡️
With more tasks, bigger rewards, and an even tougher playing field, the challenge is yours to conquer.
💪 Complete missions, accumulate points, and rise to the top of the leaderboards for your chance to claim extraordinary rewards. From challenges and quizzes to community actions, every task pushes you closer to victory.
🎁 The Best Will Be Rewarded:
🏆A $1000 USDT prize pool awaits the Lucky 100 on our Galxe campaign leaderboard
🏅Exclusive badges for the Lucky 500 contributors ( Galxe Explorer + Guaranteed Whitelist)
🎯Access to the Season 1 Expedition Grand Prize, worth up to $50,000 and 88.8m $TONCAP!
Join TON Capital Galxe Campaign -- https://app.galxe.com/quest/SAw9YJRiY3VF2oevPJpa3K/GCWPWtKwCQ
Show us what you’ve got and seize your opportunity to be part of something great in the world of TON and Web3.
⚡️The future is yours to shape!
🎉 Solana Leveling #Airdrop on #Galxe🎉
We’re giving away $5 to 10 lucky winners 💸
✅ Complete simple social tasks
✅ Join the Solana Leveling community
✅ Stay updated with the best Solana insights
👉 Enter here:https://app.galxe.com/quest/AygxpG3nDj4VfTNkmsTrpN/GCUxJt6zNX
🆕 Galxe now fully supports #TokenPocket login!
👉https://extension.tokenpocket.pro/
Galxe is the leading platform for building the Web3 community.
🔥Follow TokenPocket Space and Get Ready for the #TokenPocketChristmas on #Galxe!
👉https://galxe.com/TokenPocket
Details:
👉https://twitter.com/Galxe/status/1729918366012600584
👉https://twitter.com/TokenPocket_TP/status/1730068829311774726
⚡️Electra launches a quest on Galxe!
We are pleased to announce that🚀Electra launches an exciting $ELT token reward campaign on the #Galxe platform!
This means that Airdrop is just around the corner!
🏆
💵 As part of this campaign, you have the opportunity not only to earn $ELT tokens, but also to participate in prize draws in $USDT, unique NFTs and tokens from top partners🤝Electra!
Complete quests, follow the news and get ready for the $ELT airdrop!
➡️Take part in the campaign
#Electra#Airdrop#DeFi#Web3
Become an APTOS and SUI supporter and reach new peaks⛰
Go to Galxe 👇
https://galxe.com/apstation/campaign/GCLYeU42e1…
#Aptos#Galxe#AptosEcosystem#Sui#SuiEcosystem
https://twitter.com/CetusProtocol/status/1621413895578726400?s=20&t=idtvF7UcG6zXWiw2NhUUdA
@everyone
🔥Airdrop – Empeiria x Leap Wallet ✅
💠Reward:Empe Micro Node (worth $50) – Grants access to EMPE token staking rewards. Claiming starts after TGE.
☀️Airdrop Link :- Click Here
⚙️How to Participate?
♦️Jointheevent on Galxe
♦️Complete all listed quests
♦️Connect your wallet & verify tasks
♦️Secure yourEmpe Micro Node reward
📌Note:Limited-time event – don’t miss your chance to get early staking access with Empeiria
®Note - Please do your own research (DYOR) before joining to any airdrops project, also airdrop is 100% free. Don't send any fee or penny for receiving airdrop tokens.
#Empeiria#LeapWallet#Galxe#Airdropcomic#CryptoRewards#Web3