TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #175 · 30 окт.

В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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

Hashtags

Резултати

Пронајдени 1 слични објави

Пребарај: #antonrupert

当前筛选 #antonrupert清除筛选

🎂 October 4 — Birthday of Anton Edward Rupert (1916 – 2006), South African businessman, philanthropist, and conservationist. 🏛 Museums in South Africa connected to his legacy: • Rupert Museum (Stellenbosch) — home to one of the most important private collections of 20th-century South African art, assembled by Rupert and his wife Huberte. • La Motte Museum — located on the family’s wine estate, known for its collection of Pierneef works and Cape Dutch cultural heritage. • Hester Rupert Art Museum (Graaff-Reinet) — named after Rupert’s mother, showcasing works of South African artists from the mid-20th century. • Jan Rupert Art Centre (Graaff-Reinet) — a venue for rotating exhibitions under the Rupert Art Foundation. • Franschhoek Motor Museum 🚗 — a world-class collection of automobiles, motorcycles, and bicycles spanning over 100 years of motoring history, founded by Rupert and later expanded by his son Johann. 🕊 Anton Rupert left a remarkable cultural and environmental legacy, bridging business, art, and nature conservation. #AntonRupert#SouthAfrica#RupertMuseum#Art#Culture#Heritage#Philanthropy#MotorMuseum