В фреймворке 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
#BAKE/USDT analysis :
#BAKE is currently retracing towards the 200 EMA. The price is expected to retest this moving average before continuing its bearish momentum. The current level presents a favorable opportunity for a long entry.
TF : 2h
Entry : $0.1507
Target : $0.1700
SL : $0.1414
#BAKE/USDT analysis :
The price is in an uptrend, forming higher highs (HHs) and higher lows (HLs) above the 200-period exponential moving average (200 EMA). The price is expected to bounce back from this level and continue its bullish momentum, aiming to test the previous swing high.
TF : 1h
Entry : $0.2783
Target : $0.2929
SL : $0.2705