В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
⚡️TapSwap Community: Major News Incoming Tomorrow!
#TapSwapBeta#SkillGaming#Web3Games
TapSwap Community announces a major update about their private beta launching tomorrow, featuring three exclusive skill-based games in Telegram. Limited spots are available, and interested participants should prepare to apply using a Google form link with their Telegram handle.
Source: link
@tonlines
TapSwap Community: Elevate Your Gaming Skills with Precision
#SkillGaming#TapToWin#ClassicWithCrypto
The TapSwap Community emphasizes skill and precision in classic games like Tetris, Solitaire, and Bubble Shooter. Players are encouraged to hone their focus and ability to outplay and earn, adding purpose to their gaming experience.
Source: link
@tonlines
🎮TapSwap officially launched the beta!
The project has made an important step forward — now skill games are available for the first testers directly in Telegram. Convenient format, fast loading and no unnecessary actions.
What's included in the beta:
• 🎯 Three games where the outcome depends on your skills
• 💰 Integration with $TAPS
• 📲 Access via Telegram mini-app
⚠️ At the current stage, only selected users have access to the beta.
If you are among them, you can already try out the platform before the official release.
🗓The public launch is scheduled for early June.
#TapSwap#БетаЗапуск#SkillGaming#Web3UA
Bot link:tapswap_bot📱
Nigeria Football Hub
🎮TapSwap officially launched the beta!
The project has made an important step forward — now skill games are available for the first testers directly in Telegram. Convenient format, fast loading and no unnecessary actions.
What's included in the beta:
• 🎯 Three games where the outcome depends on your skills
• 💰 Integration with $TAPS
• 📲 Access via Telegram mini-app
⚠️ At the current stage, only selected users have access to the beta.
If you are among them, you can already try out the platform before the official release.
🗓The public launch is scheduled for early June.
#TapSwap#БетаЗапуск#SkillGaming#Web3UA
Bot link:tapswap_bot📱
INSIDER USA 👉🏻 Subscribe