В фреймворке 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
#IOST/USDT analysis :
#IOST has tested the support zone and has shown a bounce back. It is advisable to wait for a price retracement to enter long positions. The price is expected to maintain its bullish momentum, with potential to reach higher levels.
TF : 4H
Entry : $0.008550
Target : $0.011323
SL : $0.007050
#IOST/USDT analysis :
#IOST is currently experiencing a decline from the resistance zone following rejections in that region. It is anticipated to maintain its downward momentum and possibly test previous lows.
TF : 2H
Entry : $0.00500
Target : $0.00427
SL : $0.00542
✅✅ 85% Profit on #IOST/USDT for our Premium Members on On Binance Futures, ByBit USDT, KuCoin Futures, OKX Futures
👆🏻All Profit Targets Successfully Completed
👁🗨Contact @primemod to enter the most powerful premium group & make daily gains