В фреймворке PyQt (и PySide тоже) часто встречается настройка чего-либо с помощью так называемых флагов.
widget.setWindowFlags(Qt.Window)
Взаимодействие нескольких флагов делается с помощью бинарных (или побитовых) операторов.
Несколько флагов можно указать с помощью оператора "|"
list_item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
исключить флаг из уже имеющегося набора можно так
list_item.setFlags(list_item.flags() ^ Qt.ItemIsEnabled)
Добавить новый флаг к имеющимся можно так
list_item.setFlags(list_item.flags() | Qt.ItemIsEnabled)
А проверка наличия делается так
is_enabled = item.flags() & Qt.ItemIsEnabled > 0
Почему именно так? Всё дело в том как именно работают побитовые операторы. Но об этом в следующем посте.
#qt
#Radiology
A 9-year old male Queensland Heeler presents with a four day history of progressive tetraparesis. Physical exam showed him to be weakly ambulatory with support. As part of your initial workup, you take chest X-rays which are shown below. Which of the following next steps is the most appropriate test to confirm your clinical suspicion about the cause of the dog's signs?
https://t.me/vets_hub
🩻From Diamond Mines to Saving Lives!
South African company Lodox Systems has developed a unique full-body X-ray scanner — the Lodox Statscan. It can capture a full-body image in just 13 seconds, while delivering 10 times less radiation than a standard X-ray.
📜 The technology dates back to the 1990s, when engineers at De Beers, a diamond mining company, designed the scanner to detect diamonds being smuggled out of mines. Later, this same technology was adapted for medical use — allowing for rapid and low-dose full-body imaging in emergency situations.
📍 The first Statscan installation outside South Africa was in 2003. Today, Lodox systems are used in hospitals and trauma centers around the world.
#SouthAfrica#Innovation#MedicalTech#Lodox#Radiology#TraumaCare#AfricaInTheWorld#Xray#HealthTech