В фреймворке 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
🔔🔔$BUSD supply dropped to 13.7B, from 16B before @PaxosGlobal stopped issuing $BUSD :
- 512M was burnt in the past 15 hours and 1.1B the day before.
- Address holders reduced from 180K to 176K
- @justinsuntron withdrew 300M $BUSD from #Binance to #Paxos to redeem for fiat yesterday.
👉 More details: https://twitter.com/spotonchain/status/1626365035357544448
#Celsius Network transferred 459,561 $ETH ($1.02B) to several CEX in the past 8 hours, including:
- 305,254 $ETH ($674M) to #Coinbase Prime
- 146,507 $ETH ($324M) to #Paxos
- 7,800 $ETH ($17.02M) to #FalconX
Since Nov 13, 2023, Celsius Network has moved 757,626 $ETH ($1.69B) to FalconX, Coinbase, OKX and Paxos.
And currently still holds 62,469 $ETH ($138M) in address 0xdb3.
For more updates on Celsius Network, follow @spotonchain now and turn on your 🔔 at https://platform.spotonchain.ai/en/profile?address=0xdb31651967684a40a05c4ab8ec56fc32f060998d