В фреймворке 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
🏨Recommended hotels for the RAREMET-2026 participants
Dear participants of the RAREMET-2026 Congress!
The Congress website contains information about hotels that are ready to receive you on special terms during the event. In this section you will find addresses, promo codes for reservations and their validity periods.
📌 Details are available on our website.
🗓Dates of the Congress: RAREMET-2026 will be held on May 20-22 in Moscow at the RTU MIREA. The organizer is Giredmet JSC.
📱 Subscribe to our channels:
Telegram: t.me/raremet2026
MAX: max.ru/id7707072637_gos22
See you at the main forum of the rare metal industry!
#RAREMET2026#RAREMET2026#hotels#accommodation#participants