В фреймворке 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
#DEXE/USDT analysis :
#DEXE is currently in an uptrend on the higher time frame (HTF). The price is in an accumulation phase, consolidating sideways. A breakout from this consolidation is anticipated soon, which would likely continue the bullish rally and test the swing high. We should look for potential pullbacks to establish long entries.
TF : 1W
Entry : $8.260
Target : $18.100
SL : $6.340
#DEXE/USDT analysis :
#DEXE is currently facing resistance from the 200 EMA on the daily time frame. On the 4-hour time frame, it has broken and retested the support zone. The price is now likely to continue its bearish momentum and test new lows.
TF : 4H
Entry : $8.461
Target : $7.953
SL : $8.783