В фреймворке 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
⚡️bemo: Final Opportunity for Genesis ONIONs
#ONION#NFT
The bemo channel announces the last chance to mint Genesis ONIONs NFTs, linked with the ONTON ecosystem. These NFTs offer access to an ONION airdrop, private sale, and voting power within the ONIONVerse. The deadline to mint is April 21.
Source: link
@tonlines
ONTON Launches ONION Genesis NFT Collection in Partnership with TON Society
TON Society SBT holders now get exclusive 24-hour early access to the mint — just one of the many perks of being part of the #TONSociety🔠
Plus, a portion of the upcoming $ONION airdrop is reserved for Genesis NFT holders. The more NFTs you collect, the greater your final reward.
⚙️How it works:
• Open the app
• Pay 5 TON to spin
• Unwrap a Gold, Silver, or Bronze ONION NFT
• Complete a full set to boost your airdrop multiplier
💎And this is just the beginning. More collabs and exclusive benefits for SBT holders are on the way
#ONION#TON#SBT#Airdrop