В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
✨ WEEKLY LEADERBOARD UPDATE: WEEK 3 FEBRUARY CHAMPIONS! 🔼
The battle was intense, but these Gumart residents dominated the game! 🚀 Let’s celebrate our top performers who secured their spots at the top.
🏆 Top Achievers – Week 3 February:
🥇1st Place:@rich***00 - 50 USDT
🥈2nd Place:@Bury***ke - 20 USDT
🥉 3rd Place: @aoi_***ng - 20 USDT
🎮 Top 10 Most Engaged in Gumart Chat:
Each winner receives 10 USDT for keeping the conversation alive! (English messages only)
🏅 Winners, check your bot notifications and claim your rewards! The next leaderboard race is ON – will you be the next champion? ⚔️💰
#Minigame
Join the KardiaChain ♥️ Mass Adoption Mini Games for a chance to win a part of 200$!
UTC 12:00 17th Oct - 12:00 19th Oct
🎮Game Mechanics below 👇🏻
Mini Game 🎮 1:
1. Go to 🌐https://forms.gle/de2UYK7onyduqmVn8
2. Submit the correct answer the fastest to win 25$
3. Next 5 submissions with the correct answers also gets 10$ Each
Mini Game 🎮 2:
1. Go to KardiaChain's♥️ TelegramCommunity
2. Submit you proposal idea on the thread here about the future of Web 3.0 and what KardiaChain's next steps should be on the path of achieving mass adoption.
3. Receive the most like/reaction and get 25$
Next 10 submissions with the most likes/reactions also wins 10$ each
#Giveaway#MiniGame#Partnership#Web3
KardiaChain Socials :
🌐Website | 🐦Twitter |🌐Community | 🌐Channel
☑️Disclaimer: Please do your own research before joining to any project.
Do you want to learn more about #KAIDEX x Ameta? 📣
Join the KAHOOT Mini Game for a chance to Learn & Earn a reward pool of 100$ in $APLUS!
Quiz starts on 01:00 PM UTC, 3rd Oct 2022 onJoin Now
Kahoot link soon 👀
TOP 5 winners will receive 20$ of APLUS each 💰🤑
#MiniGame#Giveaway#Airdrop $KDX
Disclaimer: Please do your own research before joining to any airdrops project, also airdrop is 100% free. Don't send any fee or penny for receiving airdrop tokens. Just join airdrop for free!
✅✅✅✅#Official KuCoin and TON Present Frog Trader #Minigame on Telegram! 🤩 Brought to you by KuCoin, a leading global crypto exchange trusted by one in four crypto holders worldwide! #Get Upto 2 lack coins
🐸 Welcome reward of 10K Frog Coins! join fast guys :- https://t.me/xkucoinbot/kucoinminiapp?startapp=cm91dGU9JTJGdGFwLWdhbWUlM0ZpbnZpdGVyVXNlcklkJTNEMTA0ODM5NjMwMSUyNnJjb2RlJTNEUUJBWkdRQUs=
➖ Click on bot
➖ Check your telegram age
➖ Link your kucoin exchange account
➖ Connect telegram wallet only
➖ Premium users will get 50k
#Note :- Don't skip #early users will get more benefits join fast before end
📈
🐹Solution for the new mini-game in
Hamster Kombat
👉https:://t.me/hamster_kombat
📣Stay updated! Subscribe to our channel:
⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️
#hamsterkombat#hamster#kombat#key#btc#combo#hamsterkey#minigame#game#clicker#taptap#memecoin