В фреймворке 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
A whale is facing potential liquidations of 488.45 $WBTC($26.47M) on #Compound, with a health rate as low as 1.07 and a liquidation price of $50,429.
This whale was liquidated 3 times during the 2022 price crash, with a total of 74,426 $cWBTC($32.82M) being liquidated.
Address:
0xceef57f6c40a7cb2392eaad101ee0440aa43ba42
Lookonchain | ꘜ
Whales are accumulating $LINK.
Whale 0x3c9E withdrew 510,000 $LINK($11.13M) from #Binance over the past 2 days and deposited it into #Compound.
0x42A1 spent $1.34M to buy 59,560 $LINK 4 hours ago.
0x848a spent $1M to buy 44,846 $LINK 5 hours ago.
https://intel.arkm.com/explorer/address/0x3c9Ea5C4Fec2A77E23Dd82539f4414266Fe8f757
https://intel.arkm.com/explorer/address/0x42A1Cf900c55EC4eBC885eB870A8E1d2E2FA1727
https://intel.arkm.com/explorer/address/0x848aA08a594a14664685e7bbB3a00E38Faba4F2f