В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
#BETA/USDT analysis :
#BETA is currently consolidating sideways above the support zone. The price is expected to bounce back from this zone and test the swing high level, where rejections have been observed multiple times.
TF : 1D
Entry : $0.04732
Target : $0.05804
SL : $0.04012
✅✅ 66% Profit on #BETA/USDT for our Premium Members on Binance /Bybit/OKX & KuCoin - The trade has been closed in good profit
👁🗨Contact @primemod to enter the premium group & make daily profit
@NewsAndTipsNT📰
✈️ Telegram Android Beta
◾️Version: 11.5.0
◾️Build: 54969
What's New :
- Open button in chat list for mini apps
- Affiliate programs
- Collage in Stories
- reorder collage parts fix 🆕
- adding audio to photo collage fix 🆕
🔄Previous Version
#beta@NewsAndTipsNT
Affiliate programs
which allows users to earn commissions by referring others to specific mini-apps.
The Affiliate Programs provides a way for users to earn rewards by inviting others to use mini-apps.
How It Works:
Users share their unique referral link for a particular mini-app.
When someone accesses the mini-app through the shared referral link and spends Stars within it, the referrer earns a commission.
#beta
@NewsAndTipsNT📰
✈️ Telegram Android Beta
◾️Version: 11.3.5
◾️Build: 53989
What's New:
-fix sending external files into scheduled (selecting date and time after selection)
- show avatar menu buttons on long press even when avatar is not set for user or channel
- mention and search messages buttons in long press channel avatar menu
- fix showing username when opening location from profile
- fix showing signatures after profiles in channel enabled
- fix showing hint about group emoji pack when writing messages is not allowed (inclusing closed topic case)
- fix searching for quick reply that starts from uppercase
- fix chat jumping when messages are selected and field gets typed into
- fix showing full reaction count on long press in albums
- fix empty user name in premium locked messaging dialog
- fix showing hashtag hint when hashtag is not in latin
🔄Previous Version
#beta@NewsAndTipsNT