В фреймворке 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
Indice Signals News Forecast Starting 17th April 2026 https://www.fxpremiere.com/indice-signals-news-forecast-starting-17th-april-2026/#indices Make Money Online - FxPremiere Group
Indices Nasdaq US30 Signals Live News Today – 7th April 2026 https://www.fxpremiere.com/indices-nasdaq-us30-signals-live-news-today-7th-april-2026/#indices#us30signals
Signals Forecast for Indices News Starting 22nd April 2026: US30, NAS100, S&P 500 Outlook, U.S. Macro Risks, and Live Trading Scenarios https://www.fxpremiere.com/signals-forecast-for-indices-news-starting-22nd-april-2026-us30-nas100-sp-500-outlook-u-s-macro-risks-and-live-trading-scenarios/#indices#US30#us30signals
Indice Signals Forecast for US30 NAS100 NASDAQ GER40 Starting 15th April 2026 https://www.fxpremiere.com/indice-signals-forecast-for-us30-nas100-nasdaq-ger40-starting-15th-april-2026/#US30#NAS100#indices Make Money Online - FxPremiere Group FxPremiere Group FxPremiere Telegram Alerts Nasdaq
Indices Nasdaq US30 Signals Live News Today – 3rd April 2026 https://www.fxpremiere.com/indices-nasdaq-us30-signals-live-news-today-3rd-april-2026/#indices#US30#NAS100
Signals Forecast for FX, Gold, Indices and Crypto News Signals Starting 11th–15th May 2026: USD, XAU/USD, US30, NAS100, Bitcoin and Ethereum Weekly Outlook https://www.fxpremiere.com/signals-forecast-for-fx-gold-indices-and-crypto-news-signals-starting-11th-15th-may-2026-usd-xau-usd-us30-nas100-bitcoin-and-ethereum-weekly-outlook/#forextrading#XAUUSD#indices#crypto
Indice Signals News Forecast for US30 NASDAQ NAS100 GER40 Starting 16th April 2026 https://www.fxpremiere.com/indice-signals-news-forecast-for-us30-nasdaq-nas100-ger40-starting-16th-april-2026/#indices#US30#us30signals#NAS100 Make Money Online - FxPremiere Group
Live Indices News — US30, NAS100, GER40 & Global Markets
February 13, 2026 https://www.fxpremiere.com/live-indices-news-us30-nas100-ger40-global-markets-february-13-2026/#indices#US30#us30signals#NAS100 FxPremiere Group Nasdaq Financial Times