В фреймворке 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
🎙️WEEK 9 | LIVE GEOPOLITICAL DISCUSSION
Who Defines Ethiopia?
State Formation, Violence & the Clash Between Aithiopology vs Ethiopology
🔹 Did Ethiopia lack legitimacy at its birth—or is it being judged through Western theories that were never meant for ancient civilizations?
🔹 This live discussion critically examines recent remarks by Ethiopia’s Foreign Minister, challenges the social contract myth, and explores Ethiopia’s state formation through its own historical and civilizational lens.
📅Jan. 02, 2026
🕕8:00–10:00 PM EST | ከምሽቱ 2:00–4:00
🎙️Host: ኢትዮጵያ ትቅደም | Ethiopia First
🗣️Guest: Alexander Yohannes — Red Nile Media
🎛️Moderator: Sheralin
📡Ethiopia First. Always.
🔴RedNile Media
👇Join ኢትዮጵያ ትቅደም Telegram Channel
https://t.me/+AAE_Pc8aWTczYTA0
#Ethiopia#Geopolitics#Ethiopology#Aithiopology#StateFormation#RedNileMedia#EthiopiaFirst
🎙️WEEK 9 | LIVE GEOPOLITICAL DISCUSSION
Who Defines Ethiopia?
State Formation, Violence & the Clash Between Aithiopology vs Ethiopology
🔹 Did Ethiopia lack legitimacy at its birth—or is it being judged through Western theories that were never meant for ancient civilizations?
🔹 This live discussion critically examines recent remarks by Ethiopia’s Foreign Minister, challenges the social contract myth, and explores Ethiopia’s state formation through its own historical and civilizational lens.
📅Dec 19, 2025
🕕8:00–10:00 PM EST | ከምሽቱ 2:00–4:00
🎙️Host: ኢትዮጵያ ትቅደም | Ethiopia First
🗣️Guest: Alexander Yohannes — Red Nile Media
🎛️Moderator: Sheralin
📡Ethiopia First. Always.
🔴RedNile Media
👇Join ኢትዮጵያ ትቅደም Telegram Channel
https://t.me/+AAE_Pc8aWTczYTA0
#Ethiopia#Geopolitics#Ethiopology#Aithiopology#StateFormation#RedNileMedia#EthiopiaFirst