В фреймворке 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
#CTSI/USDT analysis :
#CTSI is currently trading at a support zone and is expected to bounce back from this level, rising to test the resistance zone. A potential gain of 140% is anticipated from the current level.
TF : 1W
Entry : $0.1405
Target : $0.3404
SL : $0.0888
#CTSI/USDT analysis :
#CTSI has bounced off from the support zone and is expected to continue its bullish momentum towards the previous swing high.
TF : 30min
Entry : $0.1250
Target : $0.1295
SL : $0.1218