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 слични објави

Пребарај: #entry

当前筛选 #entry清除筛选
Writers Cafe

@WritersCafe · Post #115 · 13.05.2018 г., 07:46

​​Mother's Day: A day to rejoice and cherish the motherhood. We must celebrate the bond mothers have towards their children, therefore we call it a surprise challenge for each one of you who love your mom! It is the day to celebrate their presence and blessings in our lives. Let's write anything like a poetry/prose/short story or whatever you want (within 10 sentences) to express the love for Mom. Note: The best three entries will be posted in @PensivePost with your names to credit. “And all my mother came into mine eyes. And gave me up to tears.” - by William Shakespeare, Henry V (1599) » please send: #entryand then your write-up to the bot using the button below » Do not forget to mention your personal identifier like (#ws for William Shakespeare if your name is William Shakespeare) » #mom for the challenge identifier » This challenge ends in next 8 hours and the results will be posted today itself at the closing of this challenge.