В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
💣The Largest DeFi Airdrop Event in History on TON is here!
Are you ready?✨ A total of over 10,000,000+ $PIX will be distributed and we are happy to remind everyone that DEX tokens have significant value. This airdrop event brings you incredible reward opportunities, and what’s even better is that everyone has a chance to win rewards. Whether you are new to the TON ecosystem or a veteran of TON DeFi, this event invites all influencers to shape the future of TON DeFi with PixelSwap.
Here is the instruction how to participate and increase your chances: Read the article
📖
#DeFi#Airdrop#DEX#TON#PixelSwap
💎PixelSwap — The First Weighted Pool DEX on TON
#PixelSwap is a distinguished modular #DEX built on the #TON blockchain. Audited by a leading global agency, PixelSwap prioritizes smart contract security as a cornerstone of the project, demonstrating this commitment through significant advancements in security infrastructure.
PixelSwap's innovative layered architecture supports a variety of algorithms, including weighted pools and LBP launches. Moreover, PixelSwap facilitates atomic transactions, enabling the execution of complex DeFi scenarios. The team aspires to be one of the most secure projects in the #DeFi space and to contribute to the overall security development of the TON ecosystem.
💎PixelSwap x 🍅Tomarket
Recently #PixelSwapbecomes a partner of Tomarket, the incentive-driven platform guiding Web2 users seamlessly into Web3 through gaming, earning, and trading!
😄 With over 42M users and 12M connected wallets, #Tomarket is redefining the Web3 experience by offering an all-in-one ecosystem where users can engage in games, earn tokens through activities, and trade assets across multiple chains — all on a single platform.
💱 By combining PixelSwap's advanced liquidity and trading solutions with Tomarket’s extensive user base, they are set to deliver a powerful ecosystem that enables users to not only swap but also access meaningful rewards and explore deeper engagement opportunities. This collaboration creates an ideal path for users to learn, earn, and stay involved in #Web3.
The $PIX Token #TGE in Q4 2024!
The team has set aside a substantial allocation of $PIX tokens for the community! Be sure to follow @PixelSwap_io and join the community for the latest updates on the Pre-TGE Airdrop Arena!
💎$PIX token serves as the utility token for #PixelSwap, the only modular #DEX that supports both Weighted Pools and Atomic Swaps on #TON.
Join ⚔️Pixel Airdrop Arena and stay tuned for more updates!
Official Links⬇️
🔗LayerPixel: Website | X | Channel | Community | Medium | Bot
🔗PixelSwap: Website | X | Channel | SWAP | Pool
🔗PixelDAO: X | Forum | Chat
⏺PixelSwap Farming Pool in🍅Tomarket
#PixelSwap recently partnered with the well-known social platform Tomarket, which allows Web2 users to easily transition to Web3 through games, earnings and trading.
There is a new farming pool available in 🍅#Tomarket app where you can get a share of $PIX depending on how much $TOMA you contribute to the pool. The pool starts tomorrow at 10:00 UTC🕓
✖️Use TOMA to get PIX!
#TOMA#PIX#earn#farming