В фреймворке 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
Methylene Blue and Nicotine Patch in Cancer Treatment with Dr. Silva
"In cancer, I think, It is actually wonderful because what it, methylene blue is, it's an electron carrier and an oxygen carrier. So this is what helps clean out the mitochondria and oxygenates the system. I also love the nicotine patch. Okay, this is something that helps excrete the virus."
Watch the entire episode at #ManInAmerica (https://jiii.io/jpgpml)
Shocking Truth: Oncologists BANNED from Discussing Cheap Cancer Cures? 🚨
The truth about cancer treatment: Drugs like Ivermectin and Fenbendazole, which are off patent and dirt cheap, are off limits for discussion. Oncologists at top tier hospitals like MD Anderson and Johns Hopkins can't even mention them, despite peer-reviewed evidence supporting their use. Why? Because Big Pharma dictates what treatments are 'allowed.' Patients are turning to me for alternatives because the system is broken.
Time to question the status quo in cancer care. Your life might depend on it.
Share if you support the right to know about all cancer treatment options! #Cancer#BigPharma#ManInAmerica