В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
It might look a little confusing at first, but pay attention.
On this chart we have DXY, GOLD and BTC.
DXY, which is a representative chart of the USD, has an inverse relationship with GOLD and BTC.
This is because when the dollar is strong, big money moves into high interest bonds that are safe.
When the dollar weakens, big money moves into safe havens and riskier assets.
What we can firstly see on the chart is that every time DXY drops, GOLD almost instantly moves higher.
Secondly, we can see that BTC also moves higher, but it lags behind GOLD.
But that’s not the most interesting thing…
The most interesting thing here is that every single time DXY has entered a down trend, BTC has began its move between 133 days and 140 days later.
This time, that gives us an end of May date as to when BTC will begin its next true move higher.
It’s just facts, right there for you to see.
#CryptoSignal#Binance#PumpAlert#FuturesTrade
30 day PNL screenshot14 New tarde profit ✈️✈️If you're want this
Type profit in 7 days ..
✅ Don’t miss the next big move — join our VIP Premium Channel now!
📩 Contact: @Future3366
🚀 Real-time signals | Pump alerts | Future trades
#CryptoSignals#VIPAccess#BinanceFutures#PumpAlert#CryptoProfits