В фреймворке 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
#NEO/USDT analysis :
#NEO is currently in an uptrend, having retraced to test a previously respected support zone. The price is expected to rebound from this level and continue its upward movement to retest previous highs.
TF : 1D
Entry : $14.00
Target : $26.21
SL : $10.50
#NEO/USDT analysis :
#NEO is currently approaching support zone. Price is expected to rebound from this zone and resume its bullish momentum to test previous highs.
TF : 2H
Entry : $19.17
Target : $23.80
SL : $17.12
#NEO/USDT analysis :
#NEO is currently in a downtrend, forming lower lows (LLs) and lower highs (LHs) structure. The price has broken the trendline and is expected to rise higher during the correction phase, testing the previous swing high.
TF : 1h
Entry : $9.24
Target : $9.61
SL : $8.99
#NEO/USDT analysis :
#NEO is presently in a downtrend, trading below the 200 EMA. The price is anticipated to maintain its bearish momentum and revisit previous lows. To contemplate initiating a short position, it is recommended to wait for a retracement and a retest of the established resistance level.
TF : 4h
Entry : $24.05
Target : $9.73
SL : $10.03