В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
🗓️ On January 26-30, a delegation from the Russian Ministry of Defence 🇷🇺 participated in a middle planning conference to prepare a joint exercise of the three experts' working groups of the ASEAN Defence Ministers' Meeting Plus (#ADMM-Plus) in Banten Province, Indonesia 🇮🇩.
🔹️The event allowed participants to exchange views on regional security issues and share Russia's position on organizing the combined field multilateral exercise.
📍Banten Province, Indonesia 🇮🇩
🗓 On November 21, Deputy Minister of Defence of the Russian Federation, Colonel General Aleksandr Fomin🇷🇺 participated in the 11th ASEAN Defence Ministers’ Meeting Plus (#ADMM-Plus) in Vientiane, the Lao PDR 🇱🇦.
🔹️In his address to ADMM Plus, the Russian Deputy Defence Minister outlined Russia's position on the most pressing security issues facing the world and the Asia-Pacific region.
🔹️At the event, ASEAN Member States confirmed their readiness to work with the Russian Ministry of Defence in key areas of military cooperation of mutual interest.
🔹️On the sidelines of the meeting, Colonel General Aleksandr Fomin held bilateral meetings with the heads of the defence ministries of Vietnam 🇻🇳, Laos 🇱🇦, Malaysia 🇲🇾 and East Timor 🇹🇱 to discuss in detail bilateral military cooperation as well as prospects for cooperation in regional multilateral formats, in particular ADMM Plus.
#RussiaADMMPlus
🗓On May 11, Ambassador of the Russian Federation to #ASEAN H.E. Mr. Evgeny Zagaynov 🇷🇺 paid a courtesy call on the Permanent Representative of Myanmar to ASEAN H.E. Ambassador Aung Myo Myint 🇲🇲.
🌏 The diplomats discussed ASEAN-Russia agenda, as well as cooperation within the framework of ASEAN-led mechanisms including #ADMM-Plus where Russia and Myanmar are currently co-chairing Experts' Working Group on Counter Terrorism.
#RussiaASEAN#ASEANRussia
Completing his mission in Jakarta Russian 🇷🇺 Ambassador to #ASEAN H.E. Mr. Alexander Ivanov sums up the work being done during his tenure in the article "ASEAN does matter to Russia. A lot".
💬Indeed, for the last several years Russia became an indispensable actor in the Asia Pacific. Our #ASEAN friends understand and appreciate a constructive stabilizing role of Russia 🇷🇺 with no hidden agenda in the region. Our philosophies of international relations, based on the principle of sovereign equality of nations, are similar.
❗️Our practical cooperation reached a status of strategic partnership in 2018, fixed during the Summit of our leaders in Singapore. During these years in addition to existing areas of cooperation, we have managed to launch and actively promote new ones, including Consultations of the High Representatives for Security Issues, Dialogue on ICT Security-related issues,meetings of Tourism ministers and others. In the end of 2021 we successfully held the first ASEAN-Russia Naval Exercises (#ARNEX) in the Indonesian territorial waters. In 2022 we organized a number of events within the framework of ASEAN-Russia Year of Scientific and Technical Cooperation. Dozens of joint projects were implemented and financed by Russia 🇷🇺 in various spheres ranging from agriculture to training of ASEAN health experts and specialists of law-enforcement agencies. We continued to develop practical cooperation between ASEAN and Eurasian Economic Union as well as with Shanghai Cooperation Organization, thus moving the processes of integration of integrations across the huge Eurasian continent.
🔻We firmly believe that #ASEAN-centered mechanisms of cooperation, created in the last 55 years and based on the principles of equality, mutual respect and constructive engagement, including the #EAS, #ARF and #ADMM-Plus, played the pivotal role in stabilizing the region, balancing the interests of all big players and promoting mutual trust, which are prerequisites of the Asia Pacific phenomenon of becoming the main engine of the global economic growth. For many decades there were no hot military conflicts in the region. Largely it is the merit of #ASEAN wisdom and its leading role in shaping multilateral cooperation here. That is why Russia strongly supports #ASEAN centrality in the region not only in words but in deeds. 🤝
🔻There are many internal and external challenges for #ASEAN in the turbulent situation of strategic ambiguity. I am sure that the current Indonesian 🇮🇩 Chair will be able to navigate the “ASEAN ship” through the troubled waters of the Indian and Pacific oceans.
🔗https://www.thejakartapost.com/opinion/2023/02/06/asean-does-matter-to-russia-a-lot.html
🗓On March 8, on the sidelines of the #EAS SOM Meeting in Jakarta, Deputy Minister of Foreign Affairs of the Russian Federation H.E. Mr. Andrey Rudenko🇷🇺 held a meeting with the Director General for ASEAN Cooperation of the Ministry of Foreign Affairs of the Republic of Indonesia H.E. Mr. Sidharto R. Suryodipuro🇮🇩.
🤝The diplomats reaffirmed their intention to consolidate efforts in order to strengthen the ASEAN-led security architecture and increase the efficiency of its mechanisms by building up inclusive practical cooperation.
They touched upon key matters of ASEAN-Russia Strategic Partnership agenda, further strengthening of cooperation within the framework of ASEAN-led fora such as the #EAS, #ARF and #ADMM-Plus, as well as discussed topical issues and regional developments in the Asia-Pacific.
#RussiaASEAN#ASEANRussia#EAS#EASSOM
🗓On 15–16 February, the delegation of the Russian Ministry of Defence🇷🇺 took part in the regular meeting of the #ASEAN Defence Senior Officials’ Meeting-Plus Working Group (#ADSOM-Plus WG) in Jakarta, Republic of Indonesia🇮🇩.
The participants discussed the progress achieved by the seven #ADMM-Plus Experts' Working Groups (EWGs) as well as plans for the next cycle 2024-2027.
The Russian delegation briefed the meeting on key threats to regional security and outlined ways towards effective regional defence cooperation. The meeting was also informed on the current progress of Russia's and Myanmar's Co-Chairmanship of the ADMM-Plus EWG on Counter Terrorism and preparations for the multilateral counter-terrorism table-top and field exercises planned for September 2023 in Russia🇷🇺.
The meeting reaffirmed readiness of the ADMM-Plus countries to cooperate in all areas of mutual interest. On the sidelines of the event Russian delegation held a number of bilateral meetings.
#ADMMPlus#ADSOMPlusWG