В фреймворке 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
#AMP/USDT analysis :
#AMP is currently exhibiting an uptrend, consistently reaching new highs while trading above the 200 EMA. The price is now retracing toward the 200 EMA and a significant support level.
It is expected that the price will test this zone and subsequently rebound, which will allow the bullish momentum to persist and potentially lead to a retest of previous highs.
TF : 1D
Entry : $0.006750
Target : $0.011915
SL : $0.004950
#AMP/USDT analysis :
#AMP has broken above a previously tested resistance level and has bounced back after a retest. This suggests a continuation of its bullish momentum, with the price likely to test previous highs from the current level.
TF : 1D
Entry : $0.005420
Target : $0.013400
SL : $0.004180
#AMP has a trading range on 12H Time frame, we expect a good pump from bottom of this range,also after breakup will have another bullish movement again
📈
❄️@signals_bitcoin_crypto❄️
❄️@Shadow_support0o❄️