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

Резултати

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

Пребарај: #stellenbosch

当前筛选 #stellenbosch清除筛选

🍇🚋 Franschhoek Wine Valley Discover the beauty of the Franschhoek Wine Valley on board the famous Wine Tram🚋 — a hop-on, hop-off experience that lets you explore at your own pace, just 75 km east of Cape Town. 🏞 With 10 different routes, every journey offers something special: ✨ world-class wine tastings 🍷 ✨ guided cellar tours 🛖 ✨ leisurely vineyard lunches 🍽 ✨ peaceful walks among the vines 🌿 The town of Franschhoek — meaning “French Corner” — is part of the Stellenbosch Municipality. Stellenbosch itself is South Africa’s second-oldest town and today stands as a vibrant center of winemaking, gastronomy, art, and culture. 🌍 #Wine#Travel#SouthAfrica#Franschhoek#Stellenbosch#CapeTown

🗓December 3 marks the birthday of Huberte Rupert (1919–2005), a South African philanthropist and art enthusiast whose legacy shaped cultural and social development in the country. 🎨💛🇿🇦 She co-founded the Rupert Museum and supported numerous initiatives in education, healthcare, and the arts. 🖼 The Rupert Museum houses a remarkable collection of modern South African art from the 1940s to the early 2000s. It is located in Stellenbosch, just 50 km east of Cape Town. Her husband, Anton Rupert, was a prominent South African businessman. #SouthAfrica#Art#Culture#Philanthropy#HuberteRupert#RupertMuseum#Stellenbosch