В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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: Last Chance for Beta Access
#TapSwap#TONGaming
The TapSwap community is wrapping up the formation of its early access group for the beta version. Users can participate in skill-based games and experience $TAPS directly through Telegram. It’s a final call to submit Telegram handles for those interested.
Source: link
@tonlines
😱 Are you missing everything again?
This is the last chance to get into the TapSwap beta test before it goes mainstream!
We've almost assembled a select group of people - those who will be the first to see how TapSwap works from the inside.
Want to go there? Then go for it!
In beta:
🎯 Games where it's important not to poke, but to think
🪙 $TAPS is not a toy, but a currency
📲 Everything via Telegram — no downloads, no headaches
Leave your nickname and we will find you (in a good way):
👉https://forms.gle/Wdp8ZsofBM6Xzjyk6
Bot link: tapswap_bot📱
#TapSwap#Бета#SkillToEarn#TONGaming
Crypto Drop Club 👉 SUBSCRIBE
⚠️ Final call to join the TapSwap beta!
We are finalizing the formation of the early access group.
If you haven't sent your Telegram nickname yet, now is the time to do it.📱
As part of the beta version you will receive:
- Access to skill-based mechanics
— Possibility to test $TAPS in operation
— Participation directly through Telegram, without unnecessary installations
📩 Leave your nickname here so we can add you to the list:
👉https://forms.gle/Wdp8ZsofBM6Xzjyk6
Bot link: tapswap_bot📱
#TapSwap#Бета#SkillToEarn#TONGaming
Nigeria Football Hub
⚠️Last chance to get into the TapSwap beta test
We are finalizing the formation of the early access group.
If you haven't sent your Telegram nickname yet, now is the time to do it.📱
As part of the beta version you will receive:
- Access to skill-based mechanics
— Possibility to test $TAPS in operation
— Participation directly through Telegram, without unnecessary installations
📩 Leave your nickname here so we can add you to the list:
👉https://forms.gle/Wdp8ZsofBM6Xzjyk6
Bot link: tapswap_bot📱
#TapSwap#Бета#SkillToEarn#TONGaming
INSIDER USA 👉🏻 Subscribe