В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
🪐 Some of the most unusual stars in the universe are "blue stragglers," like those found in the globular cluster M30. Blue stragglers appear younger and hotter than neighboring stars in their ancient cluster, likely because they formed when two stars merged or stole material from a companion—making them stand out as apparent "youngsters" among a population of stellar elders. ✨
#stars⚡#mergers⚡#clusters⚡#nasa⚡#galaxy⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 Not all galaxies fit the classic spiral or oval shapes—take the galaxy LEDA 074886, located about 70 million light-years away, which stunned astronomers with its rare rectangular structure. Unlike the familiar swirls or smooth ellipses, LEDA 074886’s boxy outline is thought to be the result of a merger between two smaller galaxies, sculpting a cosmic shape almost never seen in the universe. ✨
#galaxies⚡#mergers⚡#shapes⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 The galaxy NGC 7252, also known as the "Atoms-for-Peace" galaxy, displays a wild, tangled structure with long, luminous tidal tails created by the collision of two spiral galaxies. These sweeping arms of stars and gas stretch far from the core, forming loops and shells that resemble atomic orbital patterns, making NGC 7252 one of the most striking examples of how galactic mergers can sculpt galaxies into truly unusual shapes. ✨
#galaxies⚡#mergers⚡#peculiarity⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 In the constellation Dorado, the massive galaxy NGC 1316 bears the scars of cosmic collisions—its shell-like structures and tangled lanes of dust betray a history of devouring smaller galaxies. Radio observations have revealed that this turbulent giant also hosts powerful jets and lobes fueled by a hidden supermassive black hole at its core, making NGC 1316 a remarkable blend of chaos and creation in the southern sky. ✨
#galaxy⚡#mergers⚡#radioastronomy⚡#blackhole⚡#nasa⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
Deribit Attracts Potential Acquirers Attention
Crypto exchange Deribit is drawing interest from potential acquirers, signaling a shift in the M&A landscape for crypto platforms. This comes amid regulatory scrutiny and evolving market conditions. For more details, check the full article here: BBG.
#Crypto#Deribit#Investment#Acquisition#Exchange#Mergers#MarketTrends#Finance#Regulation#Tokens#Trading#DigitalAssets#GlobalFinance#VentureCapital#Tech#Cryptocurrency
Investors Eye Russian M&A Boom
Investment activity in Russia is on the rise, with a surge in mergers and acquisitions along with simplified IPO processes. Founders are encouraged to connect with key strategists and investors to navigate these opportunities effectively. Notably, investor Alexander Radionov, owner of M&A boutique and foodtech companies Broniboy and Bumеrang, shares insights on capital growth and successful exits on his channel. He monitors promising projects and organizes events for founders to facilitate company sales ripe for exit. Explore his channel for valuable resources on capitalization growth and exit strategies.
#Investment#M&A #IPO#Russia#BusinessGrowth#ExitStrategies#FoodTech#AlexanderRadionov#Broniboy#Bumeеrang#Capitalization#InvestorConnections#Mergers#Acquisitions#PrivateEquity#Entrepreneurship#Growth#Success#BusinessSales#MarketTrends