В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
Вечерний Ереван 🌟
International youth cooperation is an important part of humanitarian policy around the world❤️
Международное сотрудничество по линии молодёжи — это важная часть политики во всем мире 😀
#Diplomatic
Для меня любая поездка — это возможность отдохнуть и перезагрузиться.
В этот раз я чувствовал ответственность, выступая перед публикой на серьёзную тему: медийно-информационная грамотность подростков в интернете.
Эта поездка запомнилась мне большим путешествием по Еревану и множеством положительных эмоций. Отдельная благодарность за всё это — Северо-Кавказскому институту филиала ВГУЮ❤️
Я защищал научную работу среди других участников, в том числе из Армении.
Интересно, что в Ереване, особенно в центре города, расположено множество посольств. Это дало мне уникальную возможность увидеть их своими глазами и даже посетить одно из них)
#ARMENIA#Diplomatic#molod
ICC CASE AGAINST URSULA Von Der LEYEN - FOR COMPLICITY IN WAR CRIMES AND CRIMES AGAINST HUMANITY IN GAZA
Today the International Criminal Court (#ICC) has been officially called to investigate Ursula von der Leyen for #complicity in acts of #Genocide.
Reasonable grounds exist to believe that the unconditional support of the president of the #European Commission to #Israel – #military, #economic, #diplomatic and #political – has enabled #WarCrimes and the ongoing genocide in #Gaza.
– A communication is submitted today to the Office of the Prosecutor of the International Criminal Court (ICC), setting forth in detail, through facts and evidence, that there are reasonable grounds to believe that the current president of the European Commission, Mrs. Ursula von der Leyen, a national of Germany, is complicit in a number of violations of international humanitarian law, amounting to crimes within the jurisdiction of the ICC, committed by the Israeli armed forces (#IDF) against #Palestinian civilians in the #Occupied Palestinian Territory (#OPT), including the #Gaza Strip.
This communication, endorsed by various human rights groups and prominent academics and experts in international criminal law, calls the Prosecutor to initiate investigations on the basis of the information provided against Mrs. Ursula von der Leyen.
The communication documents in detail the fact that Mrs. Ursula von der Leyen personally is criminally responsible and liable for punishment for some of the war crimes, #CrimesAgainstHumanity and #genocide having been committed (and still being committed) by the Israeli armed forces in the #OPT, to the extent that she has aided, abetted and otherwise assisted in the commission or attempted commission of such crimes, including providing the means for its commission, in the meaning of Article 25(3)(c) of the #RomeStatute of the #ICC.
MRS. VON DER LEYEN ENJOYS NO FUNCTIONAL IMMUNITY BEFORE THE ICC BY VIRTUE OF ARTICLE 27 OF THE ROME STATUTE.