В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
🇺🇿 Rossiya Federatsiyasi Moliya vazirligining ilmiy-tadqiqot moliya instituti, katta ilmiy xodimi - Aleksey Popovning, Moliyaviy hisobotning asosi sifatida Xalqaro moliyaviy hisobot standartlaridan universal foydalanishga o‘tishda korxonalar uchun qanday o‘ziga xos imtiyozlar va qiyinchiliklar yuzaga kelishi mumkinligi borasida.
___
🇷🇺 Cтарший научный сотрудник Научно-исследовательского финансового института Министерства Финансов Российской Федерации - Алексей Попов, о том, какие конкретные преимущества и трудности могут возникнуть у предприятий при переходе на универсальное использование МСФО в качестве основы финансовой отчетности.
#GraduateSchool#Finance#Benefits#Standards
Web-site | Telegram | Facebook | Instagram
Uzbekistan is the right place now to look for growing your business - this message was given by many distinguished panelists at International partnership initiatives week.
Only this year the number of companies with foreign capital, who decided to utilize these opportunities to grow their business increased by 250!
You can also get the best tax regime upuntil 2040 for ITES companies, affordable talents and low cost of starting your business with the Zero Risk programme in the regions of Uzbekistan: https://outsource.gov.uz
Guest Insights:
📌Boris Tadić - former president of Serbia: "Uzbekistan is one of the most #favorable countries for business operations and investments for European companies and IT firms."
📌Raimonds Vejonis - former president of Latvia: "The extension of #benefits for IT Park residents until 2040 will increase investor #confidence."
📌Hamadoun Toure - former head of ITU: “Uzbekistan has taken the leading position in the International Telecommunication Union’s ranking for the most #affordable internet prices.”
📌Akihiro Sakurai: "Uzbekistan has the #potential to supply 300,000 young specialists to the international IT market, generating high incomes."
📌Seán McEllin: “Uzbekistan is becoming the #ideal_location for major IT companies to open their regional offices.”
With its forward-looking #digitalstrategy and #commitment to innovation, Uzbekistan is emerging as a dynamic regional hub for international businesses and tech #startups alike. Exciting times ahead for #partnerships and #growth!
Uzbekistan is shaping up to be a vibrant regional hub, creating countless opportunities for innovation and foreign partnerships.
Follow in Linkedin: https://www.linkedin.com/in/sherzod-shermatov/
#Uzbekistan#ITES#DigitalTransformation#GlobalBusiness#Investment