В фреймворке 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
Halloween Weekend Grind Never Dies! 💀📈
Even when the market’s sleeping, real traders stay awake — dreaming big, planning moves, and leveling up. ⚡
Tonight’s vibe:
No fear, no FOMO — just fun, freedom & future goals. 🍾🔥
When Monday hits, we rise again — sharper, smarter & ready to haunt those charts! 👻
📈
#TraderMindset#BinaryOptions#realbinaryoptionss
🚀WEEKEND MODE: PREPARE TO DOMINATE!🔥🚀
Champions don’t rest… they prepare. 💪📈
While others relax, real traders level up.
📊 Study the charts
🧠 Improve your strategy
🔍 Analyze your mistakes
🎯 Plan for next week
Remember —
Next week’s profits are built on this weekend’s preparation 💸
Discipline + Patience = Big Wins 🏆
If you’re serious about success, weekends are your secret weapon.
Drop in the comments 👇
“READY TO WIN 💥”
We don’t depend on luck.
We trade with skill. 🔥
#WeekendVibes#TraderMindset#BinaryOptions#StayFocused