В фреймворке 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
Episode 1: She’s in his hoodie, sitting cross-legged on the kitchen counter while he flips pancakes. Music plays low, something nostalgic. She sways, miming the lyrics with lazy exaggeration. He grins—half amusement, half adoration. There’s no rush. No plan. Just the rhythm of a morning made soft by love.
❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️
We keep finding heaven in the smallest things.
❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️
#lovelived#iloveyou
#доброеутро
Нежность Сэлинджера+эмоциональность Гао Синцзяня+внешние данные Гун Ли+современность Вирджинии Депант=Миан Миан Конфетка
By Les Créatuers :
Photo @konstantin.rivera
MUAH @richy_yuliana
Style @olgasheremeta
After all my performances ,I jumped on a plane and spent the next two weeks diving into few projects that gripped me.I’m looking forward to sharing more about the process ,and the wonderful humans I shared these experiences with plane .Still traveling ,reflecting,cataloging all that I am appreciative of.Longest I’ve been road bound for some time,reaping all the rewards .Sweet discovery .More to come..🫶🏻
#hooponopono#thankyou#iloveyou#mylilmuse#tika#blackandwhite#photooftheday#photography#moodoftheday#heavenonearth#hippie#green#travelling#muse#petitefemme#mira#purelove#haveaniceday#sunvibes Обняла!😁🙏🏻