В фреймворке 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
🎯🎯 Non Stop Huge profit on Premium signals for all Premium Members
🔥🔥#TRU/USDT has crossed all the profit targets and made a great profit of 561%
👁🗨Contact @futurechief to enter the Premium Futures & SPOT Group for daily gains
#TRU/USDT analysis :
#TRU is retracing towards the 200 EMA, indicating a potential retest before continuing its bearish momentum. This level offers a good opportunity for a long entry.
TF : 2h
Entry : $0.0460
Target : $0.0520
SL : $0.0420
#TRU/USDT analysis :
#TRU is currently in a downtrend and is expected to maintain its bearish momentum, potentially testing lower price levels.
TF : 1H
Entry : $0.0713
Target : $0.0606
SL : $0.0782
✅✅ 55% Profit on #TRU/USDT for our Premium Members on On Binance Futures, Bitget Futures, ByBit USDT, KuCoin Futures, OKX Futures
👆🏻All Profit Targets Successfully Completed
👁🗨Contact @primemod to enter the most powerful premium group & make daily gains
#TRU +143% 🤑💸💰
CoinLegs' unique algorithms give you invaluable insights into the market.
Alerts, AI, Algotrade, Algorithms and much more at CoinLegs platform.
Now is the time to earn!
www.coinlegs.com