В фреймворке 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
🚀🚀 Another massive profit made in Premium Group and this time it is#AXS/USDT which crossed All the Profit Targets for an humongous gain of 99%
🗨Contact @futurechief to enter the Binance Futures/Bybit/Kucoin/OKX Premium Signal Group & Receive daily high quality signals by being in the Premium Group
🚀🚀 Consistent profit on all the Premium signals - 315% profit made on #AXS/USDT - All profit targets covered
🎯🎯Contact - @futurechief for Premium Access
🎯🎯 Non Stop Huge profit on Premium signals for all Premium Members
🔥🔥#AXS/USDT has crossed all the profit targets and made a great profit of 734%
👁🗨Contact @futurechief to enter the Premium Futures & SPOT Group for daily gains
#AXS/USDT analysis :
#AXS is retracing towards the 200 EMA and is expected to retest this level before continuing its bearish momentum. The current level presents a favorable opportunity for a long entry, with the swing high resistance level identified as the target.
TF : 4H
Entry : $4.444
Target : $4.990
SL : $4.160
🚀🚀 315% Profit on #AXS/USDT for our Premium Members on Binance Futures/Bybit/OKXX/Kucoin/Bitget
✅✅ All target completed
👁🗨Contact @primemod to enter the Premium Group for high quality SPOT & FUTURES Signals