В фреймворке 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
#CHZ/USDT analysis :
#CHZ is currently in a downtrend and making new lows. Look for a price retracement to test the resistance zone for a short entry opportunity. Lower levels will be the target level.
TF : 2H
Entry : $0.04862
Target : $0.04200
SL : $0.05193
#CHZ/USDT analysis :
#CHZ is in an uptrend, trading above the 200 EMA. After the breakout of the previous swing high, the price is sustaining above it. The price is anticipated to continue its bullish momentum and rise higher. Wait for a pullback to the support zone for a long entry.
TF : 2H
Entry : $0.0535
Target : $0.0560
SL : $0.0519