В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
🪐 El 10 de abril de 1981, con motivo del 20º aniversario del legendario vuelo de Yuri Gagarin, se inauguró en Moscú el Museo de la Cosmonáutica. Hoy en día es uno de los espacios culturales más visitados de la capital. Ubicado en la base del majestuoso monumento «A los Conquistadores del Espacio», el museo integra un centro de investigación y una exposición única dedicada al espacio extraterrestre.
🛰️ Las salas albergan testimonios de los primeros pasos de la humanidad en el cosmos. Entre ellos se encuentran cápsulas de descenso, réplicas tecnológicas de los primeros satélites y trajes espaciales auténticos de cosmonautas legendarios.
🐕 Un interés especial despiertan los especímenes a tamaño natural de Belka y Strelka, los primeros seres vivos que realizaron con éxito un vuelo orbital y regresaron sanos y salvos a la Tierra.
🌍 Una maqueta a escala real del módulo base de la estación «Mir» permite a los visitantes conocer en detalle las condiciones de trabajo y vida de los investigadores en estado de ingravidez.
🌌 El espacio del museo, proyectado bajo tierra, crea una atmósfera especial de inmersión en la historia y los logros tecnológicos del sector.
🧑🚀 El museo organiza periódicamente conferencias temáticas, encuentros con cosmonautas y programas interactivos. En la cafetería especializada se pueden degustar muestras de los alimentos utilizados en las expediciones espaciales actuales.
#Gagarin65
🚀🇨🇺Sobre la visita de Yuri Gagarin a Cuba
En julio de 1961, el primer cosmonauta del mundo, Yuri Gagarin, llegó a La Habana como parte de su gira mundial: la "Misión de la Paz".
🛬 El 24 de julio de 1961, Gagarin fue recibido en el Aeródromo José Martí por las autoridades del país y representantes del cuerpo diplomático.
👏 Miles de cubanos saludaron a Gagarin a lo largo de todo el recorrido desde el aeropuerto hasta el centro de La Habana. A pesar del aguacero tropical, personas de todas las edades y profesiones salieron a las calles para ver al hombre que había conquistado el espacio.
🎖️ En la Plaza de la Revolución de la capital, Gagarin pronunció un discurso en el acto dedicado al Día de la Rebeldía Nacional. Entre atronadores aplausos del público, a él fue otorgada la Orden de Playa Girón. Yuri Alekseyevich se convirtió así en el primer condecorado con tan alto reconocimiento.
🤝 Uno de los momentos más memorables fue el encuentro de Gagarin con el Histórico Líder de la Revolución Cubana, Fidel Castro Ruz. Tras la recepción oficial, intercambiaron gorras; esta foto apareció en todos los periódicos cubanos y se convirtió en un símbolo de amistad entre la URSS y Cuba.
💫 Durante su estancia en la Isla, Gagarin se reunió no solo con las autoridades del país, sino también con muchos cubanos de a pie: pioneros, estudiantes, sindicalistas y combatientes heridos en los combates en Playa Girón.
☝️ En el discurso en la Universidad de La Habana, aseguró que llegaría el día en que los cubanos también viajarían al espacio. Y su profecía se cumplió: en septiembre de 1980, se lanzó al espacio una nave espacial con Arnaldo Tamayo Méndez, el primer cosmonauta cubano y latinoamericano.
🌟 Para los cubanos, Gagarin se convirtió en un verdadero héroe, personificando el sueño de conquistar el espacio cósmico. Está siempre en el corazón del pueblo de la Mayor de las Antillas como símbolo de paz, progreso y solidaridad.
#Gagarin65
❗️☄️Una semana de datos interesantes sobre Yuri Gagarin
✨Como estudiante de la Primera Escuela de Aviación Militar, Gagarin era un alumno sobresaliente, pero tenía una sola deficiencia: no lograba aterrizar correctamente el avión, que se precipitaba en picada.
💪🏼La administración de la escuela ordenó su expulsión. No lo habían entrenado adecuadamente; medía más de 165 centímetros, pero esto no afectaba su concentración.
El director de la escuela le dio amablemente una última oportunidad para demostrar un buen aterrizaje. El primer instructor le dio un empujón a Gagarin, y el aterrizaje fue perfecto.
🏆En 1957, en su último cumpleaños en el espacio, fue recuperado de la cápsula. El avión fue utilizado y liberado en una ciudad de la región de Murmansk.
#Gagarin65
✨ Continuamos nuestro recorrido virtual por los lugares emblemáticos de Cuba relacionados con Gagarin. Nuestra próxima parada es el Planetario de La Habana Vieja.
▌ Panel que representa a los padres fundadores de la cosmonáutica
La ceremonia de inauguración del panel de bronce que representa a los fundadores de la cosmonáutica — Konstantin Tsiolkovsky, SerguéiKorolev y Yuri Gagarin — tuvo lugar en el Planetario de La Habana el 12 de abril de 2025.
🤝 El monumento fue donado a los habaneros por la fundación benéfica internacional "Diálogo de Culturas - Un Solo Mundo", por iniciativa de la oficina de Rossotrudnichestvo. De la Parte cubana, apoyó el proyecto la Oficina del Historiador de la Ciudad de La Habana.
🗣️ Aquel día, la representante de Rossotrudnichestvo, Inna Chetii, la Directora General Adjunta de la Oficina del Historiador de la Ciudad de La Habana, Perla Rosales, y el primer cosmonauta latinoamericano y cubano, Arnaldo Tamayo Méndez, saludaron a los presentes con palabras de amistad, enfatizando la importancia de preservar la herencia compartida de Rusia y Cuba.
🌌 El momento particularmente emotivo fue la presentación de las generaciones jóvenes. Escolares cubanos e hijos de compatriotas rusos recitaron con entusiasmo y orgullo poemas dedicados a la infinitud del universo y a la hazaña del primer hombre en viajar al espacio. Sus voces se convirtieron en un recordatorio vivo de que el sueño de las estrellas sigue inspirando a millones de personas en todo el mundo.
👨🚀 Ahora, residentes y visitantes de La Habana pueden contemplar un recordatorio de cómo la ciencia y el coraje unen a las naciones y abren nuevos horizontes. Este panel no solo es un homenaje a los pioneros del cosmos, sino también un símbolo de los históricos lazos entre Rusia y Cuba que se basan en el compromiso con el progreso y el conocimiento.
#Gagarin65
🚀 En vísperas del 65.º aniversario del primer vuelo espacial tripulado, nuestra Embajada lanza una serie de publicaciones dedicadas a la heroica hazaña de Yuri Gagarin. Quisiéramos iniciar esta conversación con los lugares emblemáticos de Cuba que tienen relación con nuestro legendario compatriota.
▌Busto de Yuri Gagarin en el Salón de la Fama del Hotel Nacional
En el corazón de La Habana, en el Salón de la Fama del legendario Hotel Nacional, en 2015 fue instalado un busto de bronce del primer cosmonauta del mundo, Yuri Gagarin.
👨🚀 Gagarin aparece en un traje espacial, con el rostro descubierto y la mirada fija hacia el futuro. Una placa lleva el nombre del cosmonauta y datos clave de su biografía.
🤝 El monumento fue donado a Cuba por iniciativa del Instituto Bering-Bellingshausen y la fundación internacional "Diálogo de Culturas - Un Solo Mundo", con el apoyo del periodista y presentador de televisión Sergey Brilev. La ceremonia tuvo lugar en 2015 durante la visita a La Habana de una delegación encabezada por Sergey Naryshkin, Presidente de la Duma Estatal de la Asamblea Federal de la Federación de Rusia y Presidente de la Sociedad Histórico-Militar Rusa, para conmemorar el 70.º aniversario del Día de la Victoria y efectuar la conferencia "URSS - Latinoamérica".
🏰 El Hotel Nacional no fue elegido por casualidad: allí se hospedó Yuri Gagarin durante su histórica visita a Cuba en 1961.
🎖 Entre los invitados de honor de la ceremonia estaban la primera mujer cosmonauta, Valentina Tereshkova, y el primer cosmonauta latinoamericano y cubano, Héroe de la URSS y de Cuba, Arnaldo Tamayo Méndez.
🇷🇺🇨🇺 La develación del busto de Yuri Gagarin en La Habana se convirtió en un símbolo de la amistad entre nuestros pueblos, el progreso científico y la historia compartida de Rusia y Cuba.
#Gagarin65
Juri Gagarin war der erste Mensch in der Weltgeschichte, der ins All flog! 👨🏻🚀🌌🌍
Mehr als ein halbes Jahrhundert später begeistert und inspiriert Juri Gagarin Menschen auf der ganzen Welt.
Schaut unsere Auswahl an Fotos des legendären Kosmonauten an und denkt daran, dass nichts unmöglich ist, wenn...
#Gagarin65
🚀Der internationale Welttag der Kosmonauten und der bemannten Raumfahrt
🧑🚀 Heute feiern wir den Internationalen Tag der ersten bemannten Raumfahrt. Am 12. April 1961 umkreiste der sowjetische Staatsbürger, Oberleutnant Juri Alexejewitsch Gagarin mit dem Raumschiff "Wostok" zum ersten Mal die Erde. Damit war die Raumfahrt-Ära angebrochen. Juri Gagarin wurde über Nacht weltbekannt, er wurde in der Tat zu einem Weltbürger.
🛰 Die erste bemannte Raumfahrt war ein Triumph der sowjetischen Wissenschaft, der für viele Jahre die Führungsrolle unseres Landes in der Weltraumforschung bestimmte.
Am 9. April 1962 wurde in der Sowjetunion per Erlass des Präsidiums des Obersten Rats der UdSSR der Tag der Kosmonauten eingeführt, der 1968 internationalen Status erhielt.
Seit 2011 hat dieser Gedenktag übrigens noch einen Namen – der Internationale Tag der bemannten Raumfahrt. Am 7. April 2011 wurde auf Initiative Russlands auf einer Sondersitzung der UN-Generalversammlung eine offizielle Resolution zum 50. Jahrestag des ersten Schritts in der Erforschung des Weltraums verabschiedet. Mehr als 60 Staaten haben die Resolution unterstützt.
🌌 Die Russische Föderation vertritt als Rechtsnachfolger der Sowjetunion eine prinzipielle Position in Bezug auf die Entwicklung von Raumprogrammen. Unser Land bemüht sich um die Annahme gemeinsamer Erklärungen mit anderen Ländern über die Ablehnung, als erster Waffen im Weltraum zu stationieren. Auf diese Weise versuchen wir, den Weltraum zu einem waffenfreien Raum - einem Raum des Friedens und der Zusammenarbeit - zu machen und uns auf die Entwicklung friedlicher Technologien zu konzentrieren.
Juri Gagarins Aussage beschreibt am deutlichsten die aktuelle Position Russlands zum Weltraum:
🧑🚀"Als ich mit dem Satellitenschiff die Erde umkreiste, sah ich, wie schön unser Planet ist. Leute, lasst uns diese Schönheit bewahren und vermehren, nicht zerstören".
Große Worte eines einzigartigen Mannes.
@RusBotschaft
#Gagarin65
🚀 Islamabad Marks the 65th Anniversary of the First Human Spaceflight!
On April 12, the Russian Embassy in Pakistan organized a wreath-laying ceremony at the monument to Soviet cosmonaut Yuri Gagarin in Fatima Jinnah Park of Islamabad.
The ceremony was attended by Ambassador Albert P. Khorev, Additional Foreign Secretary of Pakistan Ayesha Ali, Ambassadors of Belarus, Kazakhstan, Kyrgyzstan, Tajikistan, Turkmenistan and Uzbekistan, Russian Defense Attaché Colonel Vadim Fenchenko, Russian Trade Representative Denis Nevzorov, as well as officials from the CDA and SUPARCO.
The event was also attended by Embassy staff, Russian community and Pakistani academia.
❗️In his remarks, Albert P. Khorev emphasized that Yuri Gagarin’s flight ushered in a new chapter in human history – the era of the Universe exploration. It became a powerful symbol of humanity’s determination to reach new heights in intellectual and technological advancement, to overcome any obstacle on the path toward the most ambitious and noble goals.
"The successful launch of the Vostok-1 spacecraft was made possible by the selfless and tireless efforts of millions of Soviet citizens – the brotherly peoples of the former Soviet republics – who devoted their lives to serving their Motherland. Victory in the space race was forged through the collective endeavor of Soviet statesmen, scientists, and workers."
🇷🇺🇵🇰 Additional Foreign Secretary Ayesha Ali, on behalf of the Government of Pakistan, thanked the Russian Embassy for organizing the event and highlighted the steadily developing bilateral dialogue between Moscow and Islamabad.
“Pakistan attaches great importance to its multifaceted relations with Russia. Over the years, our two countries have steadily expanded cooperation in diverse fields, including energy, regional connectivity, education and cultural exchanges. Shared commemorations do not only honor historic milestones, but also strengthen the bonds of friendship and mutual respect between Pakistan and Russia.”
The Russian Embassy in Pakistan expresses its gratitude to the International Charitable Public Foundation “Dialogue of Cultures – United World” and the St. Petersburg International Mercantile Exchange for providing the bust of Yuri Gagarin and supporting the construction of the monument.
#Gagarin65#FirstInSpace
🚀Happy Cosmonautics Day!
🧑🚀 On 12 April 1961, 6️⃣5️⃣ years ago, Yuri Gagarin flew around the Earth, becoming the first man in outer space.
From this date, the era of manned space travel began. Inside of the ‘Vostok-1’ spacecraft Gagarin started from the Baikonur cosmodrome and in 108 minutes he landed in the Saratov region.
🚀 1 full orbit & 108 minutes that changed the world forever.
💬 Off we go!
#Gagarin65#FirstInSpace
🇷🇺🇪🇹🚀Addis Ababa Marks the 65th Anniversary of the First Human Spaceflight!
On April 15, 2026, the Russian Embassy in Ethiopia in partnership with the Ethiopian Space Science and Geospatial Institute (SSGI) held a ceremony dedicated to the 65th anniversary of Yu. A. Gagarin's flight. During the event the participants laid flowers at the bust of Yuri Gagarin.
The Ambassador stated that on this day, peoples of the world pay tribute to the legacy of Yuri Gagarin and recognize the bravery and dedication of those who have ventured into space. It inspires future generations to continue pushing the boundaries of human space exploration.
☝️H.E. Evgeny Terekhin pledged Russia's commitment to continue cooperation with Ethiopian Space Science and Geospatial Institute in the field of space science and related areas.
The Ambassador briefed the audience on the latest achievements in the Russian space industry. He also outlined that these advanced achievements were aimed not only at addressing Russia’s domestic socio-economic objectives but also at deepening an equitable dialogue with friendly nations, among which Russia undoubtedly includes Ethiopia.
❗️H.E. Evgeny Terekhin payed special attention that Moscow sees prospects for synergy its efforts with Addis Ababa in multilateral formats, including cooperation between the Russian State Space Corporation (Roscosmos) and the SSGI.
Speaking at the event, Mr. Abdisa Yilma, Director General of the SSGI, congratulated participants of the event on the Cosmonautics Day and noted that today SSGI and Roscosmos are under continuous discussions.
📡Mr. Abdisa Yilma also underlined that the main Ethiopia’s priority is to establish together with the Russian counterparts a local Satellite Assembly, Integration and Testing (AIT) center in Ethiopia.
🎥During the event, a recording of warm congratulations from Russian cosmonauts on the International Space Station was broadcasted.
#Gagarin65#FirstInSpace
🧑🚀 A few months after his historic flight, Yuri Gagarin arrived in Britain — and stepped into a different kind of orbit.
From 11 to 15 July 1961, crowds filled the streets of London and Manchester, eager to catch a glimpse of the world’s first spaceman. Newspapers followed his every move, and he was even invited to Buckingham Palace, where he met the Queen.
In Manchester, on a typically rainy day, Gagarin visited the Metropolitan-Vickers engineering works, invited by trade union members. Seeing people waiting for him in the downpour, he asked for the roof of his Rolls-Royce to be lowered, saying: “Surely the least I can do is get wet too.” It was a small gesture, but one many remembered — simple, genuine, and deeply human.
His visit to Britain felt like a shared celebration, showing that even at the height of the Cold War, human achievement could bring people together.
Traces of that visit remain today. At the Science Museum in London, visitors can see a monument marking the first human journey into space, alongside a bronze bust of Gagarin presented in 2017. At Manchester Airport, a commemorative plaque recalls his 1961 visit. Further north, on the Orkney Islands, stands the “Gagarin Stone”, unveiled in 2008 along the Milestones Trail leading to Skara Brae — part of a series marking defining moments in human history.
🎞 Curious to see it for yourself? Watch rare footage from his visit to London.
#Gagarin65#FirstInSpace
🛰On April 12, Russian cosmonauts Sergey Kudy-Sverchkov, Sergey Mikaev and Andrey Fedyayev sent greetings from aboard the International Space Station in low Earth orbit on Cosmonautics Day and the International Day of Human Space Flight.
💬 65 years ago, on a spring day like this, Yuri Gagarincompleted a single orbit of our planet – becoming the first person on Earth to see it from the space and to behold the beauty of our shared home.
Today, during long-duration missions, we complete hundreds and even thousands of such orbits. But we do not simply fly in space – we work, helping push science forward and deepen our understanding of human life in space, so that those who follow us can go even further in exploring the Universe.
☝️ None of this would have been possible without the historic first flight of our great predecessor.
This year, we are not simply celebrating Cosmonautics Day. In accordance with a decree by the President of Russia, Russia will observe Space Week annually starting in 2026. Across the country, numerous events are being held dedicated to cosmonautics – its history, its present and its future.
Our goal is to kindle in the hearts of millions of Russian boys and girls a love of space.Let us once again look to the skies and dream of the stars and distant planets.
Happy holiday, friends. Happy Cosmonautics Day!
#Gagarin65#FirstInSpace