В фреймворке 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
Egountchi Behanzin dénonce à la télévision azerbaïdjanaise la colonisation française en Nouvelle-Calédonie, les massacres des autochtones Kanaks et la répression fasciste du gouvernement colonialiste français 🇫🇷 contre les indépendantistes qui réclament le droit à l’autodétermination et l’indépendance de la Kanaky.
Vive la résistance du peuple #Kanak ! Liberté pour la #Kanaky ! À bas le colonialisme français ! #NouvelleCalédonie
@egountchibehanzin
🚀 UNICE X KANAK Partnership! 🚀
@unicelab is excited to announce our partnership with @KANAK_Connect!
UNICE is an AI blockchain healthcare messenger created by doctors. It analyzes emotions from voice and facial expressions, provides AI-driven healthcare, and connects users with real doctors when needed.
KANAK is dedicated to advancing payment infrastructure and financial systems by incorporating cryptocurrency solutions and an AI-driven system.
Together, we are simplifying and securing your financial life with advanced blockchain solutions.
✅ Official Link:
unicelab.io
kanak-ai.com
#UNICE#KANAK#Partnerships
Vive la résistance du peuple #kanak ! Liberté pour la #Kanaki !
L’état colonial négrier de France pleure la mort d’un colon ( gendarme ) en nouvelle Calédonie. Question que faisait-il là-bas exactement ce occupant ?
Combien d’autochtones massacrer depuis l’occupation de la kanaky par la France coloniale ?
#FreedomKanaki#NouvelleCalédonie#Resistance#France
@egountchibehanzinTV