В фреймворке 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
🚀 zkSync to Unlock Significant Number of Tokens on April 17
zkSync is set to unlock approximately 17.314 million tokens on April 17 at 0:00 UTC+8. According to ChainCatcher, this release is part of the platform's ongoing token management strategy. The unlocked tokens are valued at around $2.66 million. This development is closely watched by market participants as it may influence the token's market dynamics.
#zkSync#TokenUnlock#Cryptocurrency#Blockchain#MarketUpdate#CryptoNews#ZK
🚀 Immutable X to Unlock 9.62 Million Tokens on April 18
Immutable X (IMX) is set to unlock approximately 9.62 million tokens on April 18 at 8 a.m. UTC+8. According to ChainCatcher, this information comes from Web3 asset data platform RootData's token unlocking data.
#ImmutableX#IMX#TokenUnlock#Web3#Crypto#Blockchain#RootData#ChainCatcher
🚀 Kaito Token Unlock Scheduled for April 20
Kaito is set to unlock approximately 12.11 million tokens on April 20 at 12:00 PM UTC+8. According to ChainCatcher, this token release is part of the Web3 asset data platform RootData's schedule. The unlocked tokens are valued at around $4.86 million.
#Kaito#TokenUnlock#Web3#RootData#Crypto#Blockchain#TokenRelease#April20#KAITO
🚀 Quai Network to Unlock 43.02 Million Tokens on April 19
Quai Network is set to unlock approximately 43.02 million tokens on April 19 at 21:00 UTC+8. According to ChainCatcher, this token release is part of the network's ongoing schedule. The tokens are valued at around $1.25 million. This development is being closely watched by stakeholders and investors in the Web3 asset space.
#QuaiNetwork#TokenRelease#Web3#Crypto#Blockchain#TokenUnlock#Investors#Stakeholders#ChainCatcher