В фреймворке 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
🪙SPIN & GET REAL CRYPTO
A new feature is live: Giveaways by MemeFi!💥
😵 Prize pool starts at $1,000,000!
How to win?
⭐️Spin the wheel
🔷 Hit the Ether icons
💯 Fill the Ether bar for a ticket to win $ETH!
The event kicks off today with a $25,000 prize pool. Each day brings new giveaways! 🥇
🔔Subscribe👉Join MemeFi
⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️
#memefi#spin#crypto
📣 Catizens! We are about to welcome the next update, includes:
Still worried about not being able to automatically buy the highest-grade airdrop cats? 📦
· The auto-buy function is coming soon! #Free your hands! 🚀
· At the same time, the offline #rewards have also been greatly advanced! This will make it easier for players to level up their cats, make #Catizen a real idle casual game! 😻
· Catizen has also adjusted the play experience of #SPIN(Increased randomness and reduced difficulty), don’t forget to try it again!
https:://t.me/catizenbot/👈
#crypto#ton#game
Spin (verb)/(noun)
Verb: to present information in a favorable or strategic way
Noun: a biased or strategic way of presenting information
Example (verb):
The government tried to spin the economic data as a success.
دولت تلاش کرد دادههای اقتصادی را بهگونهای ارائه کند که موفقیتآمیز به نظر برسد.
Example (noun):
The press secretary put a positive spin on the policy failure.
سخنگوی مطبوعاتی به شکست سیاست، تفسیر مثبتی داد.
Put a spin on : present something strategically
She put a positive spin on the election results.
او نتایج انتخابات را به شکل مثبتی تفسیر کرد.
Spin doctor : political advisor who manages public perception
The spin doctor tried to downplay the scandal.
مشاور سیاسی سعی کرد رسوایی را کماهمیت جلوه دهد.
#idioms
#discourseanalysis
#criticalthinking
#spin
#framing
#ielts#cae#fce