В фреймворке 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
In Spain, Good Friday is part of Semana Santa (Holy Week). Cities hold large religious processions.
Groups called brotherhoods organize these events. People wear long robes and pointed hoods. They walk slowly as an act of penance.
Huge floats called “pasos” show scenes from the crucifixion of Jesus. These can weigh over a ton and are carried by teams underneath.
Some cities have music with drums and bands. Others stay completely silent. People also sing emotional songs from balconies.
In Seville, processions can last all night. In Málaga, there is a tradition of pardoning a prisoner. In Valladolid, old sculptures from the 16th and 17th centuries are used.
Traditional foods include torrijas and buñuelos.
🇪🇸🕯️🎭🥁
[Read more 1]
[Read more 2]
@googlefactss
#GoodFriday#SemanaSanta#Spain#Traditions#History#Culture