В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
EU Scrutinizes Bing's Generative AI over Potential Election Risks
The European Commission is escalating its investigation into potential risks associated with generative AI features on Microsoft's Bing search engine. The Commission seeks information beyond what Microsoft previously provided.
The request stems from concerns that Bing might be violating the Digital Services Act. This act outlines risk assessments and mitigation measures for online platforms, particularly regarding "hallucinations" (false information generated by AI systems), deepfakes (manipulated media), and automated manipulation of services that could mislead voters.
The Commission emphasizes the potential threats posed by generative AI to civic discourse and electoral processes, particularly in the upcoming European Parliament elections.
Microsoft has until May 27th to comply with the legally binding request. Non-compliance could lead to significant fines of up to 1% of Microsoft's global turnover, or daily penalty payments calculated as a percentage of average daily income.
#DSA
🇦🇿 Ozarbayjonda Best Startup Project yarim final bosqichi bo‘lib o‘tdi!
“Digital Startup Awards” (DSA) butun mintaqa bo‘ylab eng iqtidorli startap asoschilarini birlashtirishda davom etmoqda. 🌟
Dunyo bo‘ylab kelib tushgan 350 dan ortiq ariza orasidan 20 ta ozarbayjonlik startap o‘z innovatsion g‘oyalarini taqdim etdi. Natijada ikki finalchi — “Starkids” va “Tryverse” — joriy yil dekabr oyida Toshkentda bo‘lib o‘tadigan Grand Final bosqichiga yo‘llanma oldi. 🚀
Jarayon tobora qizg‘in tus olmoqda — yakuniy bosqichga yaqinlashar ekanmiz, yangiliklarni kuzatishda davom eting!
📖To‘liq maqolani o'qing: startupbase.uz
—
🇦🇿Azerbaijan Hosts Its Best Startup Project Semifinal!
The Digital Startup Awards (DSA) continues to bring together the brightest founders from across the region. 🌟
Out of 350+ applications globally, 20 startups from Azerbaijan took the stage to pitch their innovative ideas — and two finalists, Starkids and Tryverse, have earned their spot in the Grand Final in Tashkent this December. 🚀
The momentum is growing — stay tuned as we move closer to the final showdown!
📖Read the full article here: startupbase.uz
#DSA#BestStartupProject#ITParkUzbekistan#AzerbaijanStartups#CentralAsiaStartups
🇦🇿 Ozarbayjonda Best Startup Project yarim final bosqichi bo‘lib o‘tdi!
“Digital Startup Awards” (DSA) butun mintaqa bo‘ylab eng iqtidorli startap asoschilarini birlashtirishda davom etmoqda. 🌟
Dunyo bo‘ylab kelib tushgan 350 dan ortiq ariza orasidan 20 ta ozarbayjonlik startap o‘z innovatsion g‘oyalarini taqdim etdi. Natijada ikki finalchi — “Starkids” va “Tryverse” — joriy yil dekabr oyida Toshkentda bo‘lib o‘tadigan Grand Final bosqichiga yo‘llanma oldi. 🚀
Jarayon tobora qizg‘in tus olmoqda — yakuniy bosqichga yaqinlashar ekanmiz, yangiliklarni kuzatishda davom eting!
📖To‘liq maqolani o'qing: startupbase.uz
—
🇦🇿Azerbaijan Hosts Its Best Startup Project Semifinal!
The Digital Startup Awards (DSA) continues to bring together the brightest founders from across the region. 🌟
Out of 350+ applications globally, 20 startups from Azerbaijan took the stage to pitch their innovative ideas — and two finalists, Starkids and Tryverse, have earned their spot in the Grand Final in Tashkent this December. 🚀
The momentum is growing — stay tuned as we move closer to the final showdown!
📖Read the full article here: startupbase.uz
#DSA#BestStartupProject#ITParkUzbekistan#AzerbaijanStartups#CentralAsiaStartups
🇲🇳 Mongoliyada Best Startup Project yarim final bosqichi boshlandi!
“Digital Startup Awards” (DSA) dasturi qizg‘in davom etmoqda — Mongoliya rasman o‘zining ilk “Best Startup Project” tanlovini o‘tkazib, eng yaxshi finalchilarni saralab oldi! 🚀
350 dan ortiq arizalar orasidan UWISH va EGUNE Mo‘g‘uliston yarim finalida g‘olib chiqdi va joriy yilning dekabr oyida Toshkentda bo‘lib o‘tadigan Grand finalda ishtirok etadi.
📖To‘liq maqolani o'qing: startupbase.uz
—
🇲🇳Mongolia Kicks Off the Best Startup Project Semifinals!
The Digital Startup Awards (DSA) program is in full swing — and Mongolia has officially hosted the first Best Startup Project competition, selecting its top finalists! 🚀
Out of 350+ applications, UWISH and EGUNE became the winners of the Mongolian semifinal and will compete in the Grand Final in Tashkent this December.
📖Read the full article here: startupbase.uz
#DSA#BestStartupProject#ITParkUzbekistan#StartupEcosystem#MongoliaStartups#Innovation#Entrepreneurship#CentralAsiaStartups
🚀 AI TRENDS | OpenAI to Be Regulated Under EU's Digital Services Act, Sources Say
OpenAI is set to be regulated under the European Union's Digital Services Act (DSA), according to sources cited by Handelsblatt. The company will be classified as a very large online search engine under the new regulations. According to Jin10, this classification will subject OpenAI to stricter compliance requirements aimed at ensuring transparency and accountability in its operations. The DSA is part of the EU's broader effort to regulate digital services and platforms, enhancing user protection and addressing issues such as misinformation and data privacy. OpenAI's inclusion under this regulatory framework highlights the growing scrutiny of AI technologies and their impact on society.
#AI#OpenAI#EU#DigitalServicesAct#DSA#Regulation#TechPolicy#DataPrivacy#Misinformation#Transparency#Accountability