В фреймворке 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
Protecting our communities from hospital-acquired infections starts with strong Infection Prevention and Control #IPC programs in our health facilities.
We must invest more in these initiatives to safeguard public health and prevent the next epidemic.
#PreventionHAIs
#FundIPC
#TurnNigeriaOrange
Protecting our communities from hospital-acquired infections starts with strong Infection Prevention and Control #IPC programs in our health facilities.
We must invest more in these initiatives to safeguard public health and prevent the next epidemic.
#PreventionHAIs
#FundIPC
#TurnNigeriaOrange
Protecting our communities from hospital-acquired infections starts with strong Infection Prevention and Control #IPC programs in our health facilities.
We must invest more in these initiatives to safeguard public health and prevent the next epidemic.
#PreventionHAIs
#FundIPC
#TurnNigeriaOrange
Sustained domestic funding for #InfectionPreventionandControl is an essential investment in the fight against healthcare-associated infections and #antimicrobialresistance.
Let's protect lives, support research, and safeguard our healthcare systems.
#TurnNigeriaOrange
#PreventHAIs
#FundIPC
Protecting our communities from hospital-acquired infections starts with strong Infection Prevention and Control #IPC programs in our health facilities.
We must invest more in these initiatives to safeguard public health and prevent the next epidemic.
#PreventionHAIs#FundIPC
#TurnNigeriaOrange#IPCTWG