В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
⚡️Toncoin: TON Nominated for Best Developer Ecosystem
#TON#developers
Toncoin has announced that TON has been nominated for the Best Ecosystem Program for Developers at the BeInCrypto 100 Awards 2025. Enthusiasts and supporters can participate in public voting to support this achievement.
Source: link
@tonlines
EVAA Celebrates TON Mainnet Anniversary
#TON#developers
EVAA marks the anniversary of The Open Network Mainnet, launched on May 26, 2021. Over four years, the TON ecosystem has flourished with the contributions of active developers and TON Core.
Source: link
@tonlines
Tonnel Network: Telegram’s Financial Growth through Strategic Partnerships
#Telegram#developers
Tonnel Network highlights how Telegram’s financial stability has been strengthened through strategic partnerships with developers. These partnerships involve app and bot development, in-app purchases, and its advertising initiatives.
Source: link
@tonlines
We're a proud sponsor of the first Flow Hackathon – a global competition from 2/21–2/26 to push the limits of #web3#onFlow.
Beyond excited to be involved in the expansion of the #ecosystem and to provide an opportunity for developers to shine! 💡✨
This is what's up:
💰 $500K in prizes
🌐 Virtual & IRL events
📚 Education phase to learn more about building #onFlow
✨ Amazing speakers and judges
👨💻 Empowering #developers to do great things
Are you ready to build awesome innovations and earn prizes for your work?
Register today! 👇
https://hackathon.flow.com