В фреймворке 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
Let's end Day 3 of #WazirX's 6th Anniversary with a Giveaway 🥳
🎁 100 lucky winners will win 85 Million $LOVELY each!
Giveaway Details 👉https://x.com/WazirXIndia/status/1765747308648694243?s=20
🔜 More rewards coming your way!
🔴 The total $ETH holding of #WazirX exploiter has risen to 59,097 $ETH ($201M)!
Among these tokens:
➡️ 15,298 $ETH ($52M) was stolen directly from the exchange;
➡️ 43,799 $ETH ($149M) was acquired by dumping various assets, notably 5.43T $SHIB ($90.2M), 20.5M $MATIC ($10.2M), and 640.27B $PEPE ($7.48M).
The exploiter has not made the next moves with these $ETH and only has around ~$12M in altcoins such as $CHR, $CELR, $OOKI, and $FRONT.
Follow @spotonchain and set alerts to see what the exploiter will do next via https://platform.spotonchain.ai/en/platform/entity/2220
Trump Launches Memecoin TRUMP on Solana
Donald Trump has launched his memecoin, $TRUMP, on the Solana blockchain, coinciding with his upcoming inauguration. The token saw a rapid price surge, with one trader earning $29.8 million from an initial investment of $1.09 million. The memecoin achieved a market cap of $11 billion shortly after its release, outperforming several notable cryptocurrencies. Amidst this, WazirX froze $3 million of stolen funds, and the U.S. Supreme Court upheld potential TikTok bans.
#Trump#Memecoin#Blockchain#Solana#Crypto#Bitcoin#CyberSecurity#WazirX#TikTok#MarketCap#Investment#Trader#Cryptocurrency#Trading#EconomicNews#SolanaBlockchain#DigitalAssets#MarketSurge#Inauguration#Finance#NFT