В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
I sprayed her butt just a little with hand sanitizer because she keeps on biting wires on the desk.. I swear just a little 🥺 & she slowly sit there, lying down, with her eyes looking at me for a while until slowly falls asleep 🥺 she stopped biting the wires but I feel bad 🥺 Is she sad? or just tired? 🥺
#random#Henoa
@quietworld🍃
Today, a thought strucked me;
I love looking at cats especially high breed cat but I never wanted to buy and take care of high breed cat because I'm scared that I'm not able to take good care of it since high breed requires high maintenance.. So, I only wanted to take care of village cat, but then, I treat the village cat like high breed cat 😂
So.. why was I scared to adopt/buy high breed cat, right? I treat my village cat like royal anyway 😂
* currently waiting for my kitten to come back from home-based grooming service (waiting anxiously) *
I hope she comes back here safe 🥺😢
#thoughts#cat#Henoa
@quietworld🍃
Yeyy she's finally back from grooming 😍 Her nails clipped, ears cleaned and she smells good ☺❤ I'll get no more scars because her habit of climbing me 🤣 for now.. until her nails grow long and sharp again 🤣
Worth the wait..
from 12:30PM until 03:40PM🥰
#cat#Henoa#chupdate
@quietworld🍃
Shopping for Henoa le Kitten again! 😍
Unplanned but I found item that I didn't know exist before that I think Henoa & I needs and I read lots of reviews saying that this shop sells a lot cheaper than other stores so why not? 😂
Will be making a video of unboxing these + review once they arrived and tested 🥰💞
Stay tuned for this video upload in my channel 🥰
#marcegetaway#youtube#kitten#Henoa
@quietworld🍃
New video uploaded! 😍
p/s: not the video I mentioned in my sneak peek post recently, that is still in the making😉
#adoptingastraykittenjourney#adoptdontshop#Henoa#kitten#youtube#chupdate
@quietworld🌻
New video uploaded! 😍
p/s: not the video I mentioned in my sneak peek post recently, that is still in the making😉
#shopee#haul#Henoa#kitten#youtube#chupdate
@quietworld🌻