В фреймворке 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
#CITY/USDT analysis :
#CITY has broken out and retested the 200 Exponential Moving Average (EMA). It is currently consolidating above the 200 EMA. The price is expected to bounce back from this level and resume its upward momentum to test higher levels.
TF : 1H
Entry : $1.107
Target : $1.160
SL : $1.075
#CITY/USDT analysis :
#CITY is currently in a downtrend, establishing new lows. The price is anticipated to retest the resistance zone before potentially reversing from there to resume bearish momentum and test lower levels.
TF : 4h
Entry : $1.220
Target : $1.083
SL : $1.300
#CITY/USDT analysis :
#CITY has broken below the support levels, forming lower lows (LLs) and lower highs (LHs) while trading below the 200 EMA. The price is expected to maintain its bearish momentum and test lower levels.
TF : 2H
Entry : $1.826
Target : $1.715
SL : $1.903
#CITY/USDT analysis :
#CITY is presently in a downtrend, trading below the 200 EMA. The price is currently consolidating above support levels. It is expected to be breached by the price soon and will continue its bearish momentum on lower time frames to test previous lows. Wait for a break of the $1.945 level to initiate a short position.
TF : 1H
Entry : $1.945
Target : $1.853
SL : $2.005