В фреймворке 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
The EGLD Community Platform Goes Live 💫
We have been Elrond community members (and #hodlers) for a long time already and deeply care about the Elrond ecosystem. Today we are announcing the launch of a product we have been working on behind the scenes for quite some time and will hopefully add a lot of value to the Elrond ecosystem.
Meet the "EGLD Community" - a social platform to discover, learn and talk about all-things Elrond!
Discover more and sign up here:
➡️https://bit.ly/36ILzfM
BIT x DWF Labs
Crypto Snapshot [27 Jan] 📰
Highlights:
🔸 Diamond Hands Rule The Charts As #Bitcoin#HODLers Continue To Hold Despite Gains
🔸 The Open Network Move Towards Utility By Suspending Inactive Wallets
🔸 CRV Liquidity Providers Hungry For More Options
Full read here.
🥸 Above is a 10-year chart of significant #altcoins and the number of non-empty wallets (#hodlers) in the corresponding networks: #Litecoin: 8.08M wallets #Dogecoin: 6.69M wallets #XRP Ledger: 5.24M Wallets #Cardano: 4.48M Wallets #Shiba Inu: 1.39M wallets #Chainlink: 722K wallets