В фреймворке 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
#FUN/USDT analysis :
#FUN has established a breakout from its trendline after rebounding from the support zone. The price is anticipated to continue rising from its current level and is likely to test the previous swing high.
TF : 4H
Entry : $0.003263
Target : $0.003644
SL : $0.003008
#FUN/USDT analysis :
#FUN is currently consolidating within a resistance zone near the 200 EMA. A price rejection is expected from there, and a continuation of the downtrend is anticipated. Wait for the price to break below the trendline for a short entry.
TF : 2H
Entry : $0.00314
Target : $0.00287
SL : $0.00326