В фреймворке 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
#ELF/USDT analysis :
#ELF is currently in an uptrend, forming higher highs (HHs) and higher lows (HLs). Following an impulsive move, the price has retraced to the 200 EMA and a key support zone. It is anticipated that the price will rebound from this level and resume its bullish momentum, aiming to test the previous swing high.
TF : 1D
Entry : $0.4500
Target : $0.8400
SL : $0.3550
#ELF/USDT analysis :
#ELF is currently consolidating above the previously respected support zone. The price is expected to bounce back from this level and continue its bullish rally, potentially testing previous highs.
TF : 1W
Entry : $0.4124
Target : $0.7853
SL : $0.3060