В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
🎯Big Opportunity: Turn 2 TON into 100 TON!💰
Get ready to test your luck with our latest Lottery Draw on Gemifaucet!
🎟Ticket Price: Only 2 TON
🏆Winning Prize: Up to 100 TON
⏳Draw Time: Every 3 Days
Here’s your chance to multiply your TON in a simple and exciting way. Just grab your ticket, sit back, and wait for the draw — one lucky winner will walk away with a massive reward!
🔥 Don’t miss out — the sooner you enter, the bigger the prize pool grows.
🚀Buy your ticket now and secure your chance to win big!
#Gemifaucet#Lottery#WinTON#CryptoOpportunity
Buy Now
🎉Exciting Update: Lottery Feature is Now Live on Gemifaucet!🎉
We’re thrilled to introduce a brand-new way to win big on Gemifaucet — our Lottery System is officially launched!
🎟How it works:
* Purchase your lottery tickets directly داخل the app
* Each ticket gives you a chance to win
* One lucky winner takes home the entire prize pool💰
🔥 The more participants, the bigger the rewards — so don’t miss your chance to be part of it!
This feature is designed to make your experience more engaging, rewarding, and fun. Whether you're a regular user or just getting started, now is the perfect time to try your luck.
🚀Start buying your tickets today and aim for the jackpot!
Stay tuned for more updates and features coming soon.
#Gemifaucet#LotteryLaunch#WinBig#CryptoRewards
💥 OFFICIAL PARTNERSHIP ANNOUNCEMENT 💥
We’re pleased to announce an official partnership between Gemifaucet and AdsGram, focused on improving monetization quality and user experience across our platform.
🚀 About Gemifaucet
Gemifaucet is a Telegram mini app where users receive rewards by interacting with tasks and ads in a simple, transparent, and user-friendly environment.
📊 About AdsGram
AdsGram is a leading Telegram Native Ads platform trusted by top Telegram apps and communities. It provides seamless, non-intrusive ad solutions with strong performance, advanced analytics, and a proven monetization ecosystem.
🤝 Why this partnership matters
By this official partnership formalizes our collaboration and strengthens our monetization infrastructure.
👉 Gemifaucet: @gemifaucet_bot
👉 AdsGram: @adsgram_ai
Thank you for your continued support — more updates coming soon! 🚀
#OfficialPartnership#Gemifaucet#AdsGram#TelegramMiniApp#Announcement