В фреймворке 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
fshs (2025) Sedative
#drone#meditative#ambient#fshs#SSI
Тугой горизонт неторопливо разворачивающихся событий, чья ритмика скорее про статику и акт созерцания: перед нами разворачивается роскошная галерея изящных и медленных гармоний, которые просто восхищают воображение и успокаивают ум. Очередная превосходная работа на лейбле «Симфоническая Тишина Внутри», чей каталог продолжает пополняться ценными жемчужинами талантов.
P E A C E F U L / Grooming Retreat by Gartnerfuglen + Mariana de Delás
The #minimalspace (3x3 meters footprint), functions as a #groomingretreat for one person. The structure, made by local #timberframes , elevates the cocoon to have exclusive views whilst giving a sense of translucent privacy to the user.
.
Layers of white netting frames are interlaced throughout the interior to grant different opacities for each specific use. The subtle introvertness of the structure encourages the user to take a break from the multitasking contemporary madness, and centre on individual mental and bodily hygiene. With importance on grooming’s #meditative (not cosmetic) qualities, the space inspires the user to devote time to the reconnection of the mind to the shell.
#arch_shovel#architecture#archidaily