В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
#анатомия#ноги#anatomy#legs
Quick Guide: Drawing Legs
1. Proportions
The leg is typically 4-4.5 times the height of a character's head (measured in "head" units).
The thigh (from the pelvis to the knee) and the shin (from the knee to the ankle) are approximately equal in length.
2. Basic Shapes
Thigh: Think of it as two connected cylinders or a cone tapering slightly from the pelvis. The outer thigh is rounder and more convex due to the muscles.
Knee: This is the central hinge. Simplify it into a cube or sphere, making sure the kneecap protrudes in the front.
Shin: This is the most voluminous part at the back. Simplify the shin into a cylinder that tapers toward the ankle. The calf muscles create a distinctive bulge at the back.
@anatomyarthub
#анатомия#ноги#anatomy#legs
Форма ног зависит от формы костей и мышц. Вы можете в этом убедиться, глядя на анатомические рисунки.
Наши ноги состоят из следующих костей:
1 — крестец;
2 — тазовая кость;
3 — бедренная кость;
4 — надколенник;
5 — малоберцовая кость;
6 — большеберцовая кость;
7 — кости стопы
Самый эффективный способ выучить анатомию ног, как вы помните— это нарисовать скелет ноги, а поверх нее (лучше другим цветом) мышцы. А будущем достаточно схематично обозначать построение ног и накидывать их основную форму
The shape of the legs depends on the shape of the bones and muscles. You can see this by looking at anatomical drawings.
Our legs are made up of the following bones:
1 - sacrum;
2 - pelvic bone;
3 - femur;
4 - patella;
5 - fibula;
6 - tibia;
7 - foot bones
The most effective way to learn the anatomy of the legs, as you remember, is to draw the skeleton of the leg, and on top of it (preferably in a different color) the muscles. In the future, it will be enough to schematically indicate the construction of the legs and outline their basic shape
Аяҡ формаһы һөйәк һәм мускул формаһына бәйле. Анатомик һүрәттәргә ҡарап, быға инана алаһығыҙ.
Аяҡтарыбыҙ түбәндәге һөйәктәрҙән тора:
1 - һигеҙенсе;
2 - янбаш һөйәге;
3 - бот һөйәге;
4 - быуын аҫты ҡунысы;
5 - бәләкәй һаҡаллы һөйәк;
6 - ҙур бурса һөйәге;
7 - табан һөйәктәре
Аяҡ анатомияһын өйрәтеүҙең иң һөҙөмтәле ысулы, иҫләйһегеҙме - ул аяҡ һөлдәһен һүрәтләү, ә уның өҫтөндә (иң яҡшыһы башҡа төҫ) мускулдар. Ә киләсәктә аяҡтарҙың төҙөлөшөн схемалы рәүештә билдәләп, уларҙың төп формаһын һалыу ҙа етә
@anatomyarthub