В фреймворке 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
#mdx
This free interactive course teaches Product Managers to use Claude Code for daily tasks like processing notes, writing PRDs, analyzing data, and strategy planning through hands-on modules (4-6 hours). Clone the repo, run `claude`, and follow guided lessons with agents and file tools—no setup needed yet. You'll work faster, get instant multi-perspective feedback, and boost productivity without quality loss.
https://github.com/carlvellotti/claude-code-pm-course
#MDX result
1 and 2 target achieved in just 1 house 21 minutes ✅
One more huge quick profit 11%🤑💰🤑
👉 Still thinking? The more you wait more you lose profit
☎️ Contact @MichaelStrategiesVip for membership and grab next breakout signal
#MDX bounced back from the Trendline on 6H Time frame,we expect a good bullish momentum from the Green zone,send it to the moon 🚀
❄️@signals_bitcoin_crypto❄️
❄️@Shadow_support0o❄️