В фреймворке 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
#CAKE/USDT analysis :
#CAKE has retraced and tapped the previous resistance zone, which is now support for the price. Bullish momentum is expected from the current level. Wait for the price to bounce back and break out of the $2.614 level to go long, with the previous swing high as the target level.
TF : 1D
Entry : $2.614
Target : $4.180
SL : $1.992
#CAKE/USDT analysis :
#CAKE is currently in an uptrend, forming higher highs (HHs) and higher lows (HLs) above the 200 Exponential Moving Average (200EMA). The price is anticipated to undergo a retracement and test a support zone before resuming its bullish momentum. A new high is likely to be established soon.
TF : 15min
Entry : $2.033
Target : $2.091
SL : $2.004