В фреймворке 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
#WeekendQuest starts now! ⚔️🔥
Chat’s buzzing — love it!
If you haven’t checked out the new Games section yet — now’s your moment.
Today’s quest is wild:
Play Bison Storm — our storm-chasing beast with a x25,000 Max Win!
Hit that Max — and you’ll win a Treasury Bison Storm!
💰 Last month these Treasuries earned $500+ in rewards.
Real value. Passive income. Big flex.
What to do:
1. 🎰 Play Bison Storm in @true_coin_bot
2. ⚡ Hit the Max Win (x25,000)
3. 📸 Drop a screenshot in the chat with #bisonwinner
We’ll verify it. No cheats — only true hunters.
⚠️Only 3 Treasuries available — first come, first stormed!
Let the hunt begin!
Play| Website|Twitter|Truecoin chat| Instagram | YouTube | Marketplace
ALL TREASURIES CLAIMED!
⚡️ What. A. Day. ⚡️
We honestly didn’t expect it to happen this fast — but you guys went full beast mode and claimed ALL 3 Treasuries in Bison Storm in just one day!
Insane luck. Epic energy.
Let’s give a thunderous shoutout to our Max Win legends:
1️⃣@mephostophil
▶️Watch the replay
2️⃣@felikyss
▶️Watch the replay
3️⃣@Alexey7878
▶️Watch the replay
Winners — DM @ze_bro to claim your treasure!
Your ⚱️Bison Storm Treasuryis waiting.
#questwinner
–––––––––––––––––––
But wait — that’s not the end.
You smashed it so hard, our CEO decided to join the party.
This Sunday, he’s putting up his personal Treasury for a BONUS QUEST in Battle Rage!
🏆 1 Battle Rage Treasury — CEO Edition
🔥 Challenge details:
⚔️ Max Win in Battle Rage
💰 Minimum qualifying bet: 300 Coins
⏳ 1 winner only — first to hit takes it.
One shot. One treasure. One legendary chance.
Will you be the one to claim it?
#weekendquest#battlerage
BOOM!
First Treasury Bison Storm just got claimed!
@mephostophil hit the x25,000 Max Win and walked away with the prize.
1 down.
2 left.
Your turn?
#questwinner#weekendquest#bisonstorm
Replay: https://launcher.grandgames.io/replay/bison-storm-96/biso9637002456bd724d78aaa4446779b9018c/cb4d3bbcd58ea5a328b490cb6298f0cf218e7ab679715b0aeb5a1bacce5effcc