В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
#DGB/USDT analysis :
#DGB is expected to retest the 200 EMA before continuing its bearish trend. This creates a potential buying opportunity on lower time frames (LTF), and the current level is a good point for long trades.
TF : 4H
Entry : $0.00865
Target : $0.00970
SL : $0.00797
#DGB/USDT analysis :
#DGB is currently in a downtrend, consistently making new lows while trading below the 200 EMA. The price is now showing a retracement towards the 200 EMA and the resistance zone. It is expected to reverse and continue its bearish momentum. It is recommended to wait for the price to retest this zone and demonstrate rejection before considering a short entry.
TF : 1D
Entry : $0.00703
Target : $0.00541
SL : $0.00814
#DGB/USDT analysis :
#DGB has broken the support levels and has retested the zone, which is now acting as resistance for the price. The price is expected to decline from this level and test the previous swing low.
TF : 4H
Entry : $0.00662
Target : $0.00634
SL : $0.00681
#DGB/USDT analysis -
The current price movement of #DGB shows a rejection from the resistance zone after establishing a lower low. There is an anticipation of further decline from this point with a potential retest of the previous low. To effectively manage risk, it is advisable to set a stop loss above the rejection zone.
TF : 1h
Entry : $0.00716
Target : $0.00616
SL : $0.00757
#DGB👀
The second chart fully and automatically generated by our algorithm 🤖
All drawings are based on only mathematical values and calculations instead of emotions.
Interested? Check out www.coinlegs.com
#DGB hit 34 today 🔼
Trade opened on 24 March ✨
In both spot n future
Join team @CryptoProfitCoach🔝
⭐⭐ Lifetime Membership opened for a limited time⭐👈👇👇
🟥Multiply your wealth into multiple folds and Get Unique opportunity to trade with @CryptoProfitCoach
✨Buy when he buy sell when he sell...Know what Gem he holding✨
Join team @CryptoProfitCoach🟥
for mega gains and multiply your wealth
✅ Get personalized attention in every trade
✅More trades and Mega profits.
✨ Inside info/Secret info of Coin
✅No.1 Pump Tracking Services.
✅ High End Profit Targets
✅ 24x7 Support in all trades
✅ Get Entry n High end profit Exit with Team in every trade
✨Discounted price -500$ for a year with 24x7 chat support ✅
✨Today's decision can change your tommorrow✨
https://forms.gle/U519Ye8sCmvVE2Pv9
🟥Click here 👆👆✨✨