В фреймворке 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
Binance Futures,#BSB Launches Its Permanent Contract
▪️ The USDⓈ-margined BSB permanent contract will be launched on the platform on March 25, 2026.
▪️ The current market value of BSB is recorded as approximately $17 million.
🚀 Back to Back profits are made in the Premium Group
🎯🎯#BSB/USDT has covered all the target to give a Profit of 470% to all Premium Members
👁🗨Contact @futurechief to enter the Premium Futures & SPOT Group for daily gain